本文整理汇总了Java中com.github.mikephil.charting.formatter.DefaultAxisValueFormatter类的典型用法代码示例。如果您正苦于以下问题:Java DefaultAxisValueFormatter类的具体用法?Java DefaultAxisValueFormatter怎么用?Java DefaultAxisValueFormatter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultAxisValueFormatter类属于com.github.mikephil.charting.formatter包,在下文中一共展示了DefaultAxisValueFormatter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeChart
import com.github.mikephil.charting.formatter.DefaultAxisValueFormatter; //导入依赖的package包/类
protected void initializeChart() {
Description description = new Description();
description.setText("");
messagesChart.setDescription(description);
messagesChart.setNoDataText(getIdleText());
messagesChart.setTouchEnabled(false);
messagesChart.setDragEnabled(false);
messagesChart.setPinchZoom(false);
messagesChart.getLegend().setEnabled(false);
messagesChart.getAxisLeft().setAxisMinimum(0);
messagesChart.getAxisLeft().setGranularity(1f);
messagesChart.getAxisRight().setEnabled(false);
messagesChart.getXAxis().setAxisMinimum(0);
messagesChart.getXAxis().setGranularity(1f);
messagesChart.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
messagesChart.getXAxis().setValueFormatter(new DefaultAxisValueFormatter(0));
LineData data = new LineData();
data.setValueTextColor(Color.WHITE);
messagesChart.setData(data);
}
示例2: setValueFormatter
import com.github.mikephil.charting.formatter.DefaultAxisValueFormatter; //导入依赖的package包/类
/**
* Sets the formatter to be used for formatting the axis labels. If no formatter is set, the
* chart will
* automatically determine a reasonable formatting (concerning decimals) for all the values
* that are drawn inside
* the chart. Use chart.getDefaultValueFormatter() to use the formatter calculated by the chart.
*
* @param f
*/
public void setValueFormatter(IAxisValueFormatter f) {
if (f == null)
mAxisValueFormatter = new DefaultAxisValueFormatter(mDecimals);
else
mAxisValueFormatter = f;
}
示例3: setValueFormatter
import com.github.mikephil.charting.formatter.DefaultAxisValueFormatter; //导入依赖的package包/类
/**
* Sets the formatter to be used for formatting the axis labels. If no formatter is set, the
* chart will
* automatically determine a reasonable formatting (concerning decimals) for all the values
* that are drawn inside
* the chart. Use chart.getDefaultValueFormatter() to use the formatter calculated by the chart.
*
* @param f
*/
public void setValueFormatter(AxisValueFormatter f) {
if (f == null)
mAxisValueFormatter = new DefaultAxisValueFormatter(mDecimals);
else
mAxisValueFormatter = f;
}