本文整理汇总了Java中com.github.mikephil.charting.data.ChartData.setValueTextColor方法的典型用法代码示例。如果您正苦于以下问题:Java ChartData.setValueTextColor方法的具体用法?Java ChartData.setValueTextColor怎么用?Java ChartData.setValueTextColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.data.ChartData
的用法示例。
在下文中一共展示了ChartData.setValueTextColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例2: 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());
}
示例3: styleData
import com.github.mikephil.charting.data.ChartData; //导入方法依赖的package包/类
public void styleData(ChartData data) {
data.setValueTypeface(mTy);
data.setValueTextSize(8f);
data.setValueTextColor(Color.WHITE);
}
示例4: 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());
}