本文整理汇总了Java中com.github.mikephil.charting.formatter.AxisValueFormatter类的典型用法代码示例。如果您正苦于以下问题:Java AxisValueFormatter类的具体用法?Java AxisValueFormatter怎么用?Java AxisValueFormatter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AxisValueFormatter类属于com.github.mikephil.charting.formatter包,在下文中一共展示了AxisValueFormatter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: chartXAxisStyling
import com.github.mikephil.charting.formatter.AxisValueFormatter; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void chartXAxisStyling(XAxis xAxis) {
xAxis.setPosition(XAxis.XAxisPosition.TOP);
xAxis.setTextColor(getResources().getColor(R.color.traffic_chart_text_color_light));
xAxis.setDrawAxisLine(true);
xAxis.setDrawGridLines(false);
xAxis.setCenterAxisLabels(true);
xAxis.setValueFormatter(new AxisValueFormatter() {
@Override
public String getFormattedValue(float value, AxisBase axis) {
return Utils.humanReadable((long) value);
}
@Override
public int getDecimalDigits() {
return 0;
}
});
}
开发者ID:DmitryMalkovich,项目名称:gito-github-client,代码行数:20,代码来源:TrafficFragment.java
示例2: PFAMarkerView
import com.github.mikephil.charting.formatter.AxisValueFormatter; //导入依赖的package包/类
PFAMarkerView(Context context, AxisValueFormatter xValueFormatter, int valuesSelectedItemPos, NumberScale numberScale)
{
super(context, R.layout.statistics_marker_view);
this.xValueFormatter = xValueFormatter;
this.context = context;
markup = (TextView) findViewById(R.id.textview_chart_markup);
String numberFormat;
if ( valuesSelectedItemPos == StatisticsQuery.PRICE )
{
numberFormat = context.getResources().getString(R.string.number_format_2_decimals);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String defaultCurrency = context.getResources().getString(R.string.currency);
this.unit = prefs.getString(SettingsKeys.CURRENCY, defaultCurrency);
}
else
{
numberFormat = context.getResources().getString(R.string.number_format_0_decimals);
this.unit = context.getResources().getString(R.string.statistics_quantity_unit);
}
this.context = context;
this.numberScale = numberScale;
this.format = new DecimalFormat(numberFormat);
}
开发者ID:SecUSo,项目名称:privacy-friendly-shopping-list,代码行数:27,代码来源:PFAMarkerView.java
示例3: setValueFormatter
import com.github.mikephil.charting.formatter.AxisValueFormatter; //导入依赖的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;
}
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:17,代码来源:AxisBase.java
注:本文中的com.github.mikephil.charting.formatter.AxisValueFormatter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论