当前位置: 首页>>代码示例>>Java>>正文


Java ChartData.setValueTypeface方法代码示例

本文整理汇总了Java中com.github.mikephil.charting.data.ChartData.setValueTypeface方法的典型用法代码示例。如果您正苦于以下问题:Java ChartData.setValueTypeface方法的具体用法?Java ChartData.setValueTypeface怎么用?Java ChartData.setValueTypeface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.mikephil.charting.data.ChartData的用法示例。


在下文中一共展示了ChartData.setValueTypeface方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setPieChart

import com.github.mikephil.charting.data.ChartData; //导入方法依赖的package包/类
/**
 * Set the pie pattern
 * @param pieChart chart
 * @param chartData pie chart data
 * @param title chart title
 * @param tf Typeface font
 */
public static void setPieChart(PieChart pieChart, ChartData<?> chartData,
                               SpannableString title, Typeface tf) {
    chartData.setValueFormatter(new PercentFormatter());
    chartData.setValueTextSize(11f);
    chartData.setValueTextColor(Color.BLACK);
    chartData.setValueTypeface(tf);

    pieChart.setUsePercentValues(true);
    pieChart.getDescription().setEnabled(false);
    pieChart.setExtraOffsets(5, 10, 5, 5);
    pieChart.setDragDecelerationFrictionCoef(0.95f);
    pieChart.setCenterTextTypeface(tf);
    pieChart.setCenterText(title);
    pieChart.setExtraOffsets(20.f, 0.f, 20.f, 0.f);
    pieChart.setDrawHoleEnabled(true);
    pieChart.setHoleColor(Color.WHITE);
    pieChart.setTransparentCircleColor(Color.WHITE);
    pieChart.setTransparentCircleAlpha(110);
    pieChart.setHoleRadius(58f);
    pieChart.setTransparentCircleRadius(61f);
    pieChart.setDrawCenterText(true);
    pieChart.setRotationAngle(0);
    pieChart.setRotationEnabled(true);// enable rotation of the chart by touch
    pieChart.setHighlightPerTapEnabled(true);
    pieChart.setEntryLabelTextSize(10f);

    Legend l = pieChart.getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);
    l.setOrientation(Legend.LegendOrientation.VERTICAL);
    l.setDrawInside(false);
    l.setEnabled(false);

    pieChart.setData((PieData) chartData);
    pieChart.animateY(DURATION_MEDIUM, Easing.EasingOption.EaseInOutQuad);
    pieChart.highlightValues(null);// undo all highlights
    pieChart.invalidate();

}
 
开发者ID:graviton57,项目名称:DOUSalaries,代码行数:47,代码来源:ChartHelper.java

示例2: setVerticalBarChart

import com.github.mikephil.charting.data.ChartData; //导入方法依赖的package包/类
/**
 * Set the vertical bar  pattern
 * @param barChart chart
 * @param chartData pie chart data
 * @param typeface Typeface font
 */
public static void setVerticalBarChart(Context context, BarChart barChart, ChartData<?> chartData,
                                        Typeface typeface) {
    // create a custom MarkerView (extend MarkerView) and specify the layout to use for it
    ExperienceMarker marker = new ExperienceMarker(context, R.layout.marker_exp_age);
    marker.setChartView(barChart); // For bounds control
    barChart.setMarker(marker);
    //fix crash com.github.mikephil.charting.charts.Chart.drawMarkers(Chart.java:731)
    barChart.setDrawMarkers(false);

    barChart.getDescription().setEnabled(false);
    barChart.setDrawGridBackground(false);
    barChart.setDrawBarShadow(false);
    XAxis xAxis = barChart.getXAxis();
    xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
    //Sets the number of labels for the x-axis (display all the x-axis values)
   // xAxis.setLabelCount(chartData.getEntryCount());
    xAxis.setTypeface(typeface);
    xAxis.setDrawGridLines(false);
    xAxis.setDrawAxisLine(true);
    YAxis leftAxis = barChart.getAxisLeft();
    leftAxis.setTypeface(typeface);
    leftAxis.setSpaceTop(20f);
    leftAxis.setAxisMinimum(0f);

    YAxis rightAxis = barChart.getAxisRight();
    rightAxis.setTypeface(typeface);
    rightAxis.setSpaceTop(20f);
    rightAxis.setAxisMinimum(0f);
    chartData.setValueTypeface(typeface);
    barChart.setData((BarData) chartData);
    barChart.setFitBars(true);
    barChart.animateY(DURATION_SHORT);
}
 
开发者ID:graviton57,项目名称:DOUSalaries,代码行数:40,代码来源:ChartHelper.java

示例3: styleData

import com.github.mikephil.charting.data.ChartData; //导入方法依赖的package包/类
protected void styleData(ChartData data) {
    data.setValueTypeface(mTf);
    data.setValueTextSize(8f);
    data.setValueTextColor(Color.DKGRAY);
    data.setValueFormatter(new PercentFormatter());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:RealmBaseActivity.java

示例4: styleData

import com.github.mikephil.charting.data.ChartData; //导入方法依赖的package包/类
public void styleData(ChartData data) {
    data.setValueTypeface(mTy);
    data.setValueTextSize(8f);
    data.setValueTextColor(Color.WHITE);
}
 
开发者ID:dscn,项目名称:ktball,代码行数:6,代码来源:SchoolAllPeopleDetailAcitivty.java

示例5: styleData

import com.github.mikephil.charting.data.ChartData; //导入方法依赖的package包/类
protected void styleData(ChartData data) {
        data.setValueTypeface(mTf);
        data.setValueTextSize(8f);
        data.setValueTextColor(Color.WHITE);
//        data.setValueFormatter(new PercentFormatter());
    }
 
开发者ID:dscn,项目名称:ktball,代码行数:7,代码来源:RealmBaseActivity.java


注:本文中的com.github.mikephil.charting.data.ChartData.setValueTypeface方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。