【发布时间】:2019-01-23 15:08:41
【问题描述】:
我目前是第一次在 Android 上使用 AnyChart。数据显示正确,到目前为止一切正常。但我无法格式化 x 轴上的值。
我尝试使用
cartesian2.xAxis(0).labels("{%Value}{numDecimals:2}");
但它没有任何作用。我只想要两个十进制数字。我没有在网上找到任何解决方案,因为大多数文档都是关于 JS 的。
编辑:
APIlib.getInstance().setActiveAnyChartView(brightplot);
List<DataEntry> brightnessdata = createSeries(maxBrightnessRow);
Cartesian cartesian2 = AnyChart.column();
cartesian2.data(brightnessdata);
cartesian2.title("Intensitätsverteilung");
cartesian2.yScale().minimum(0d);
cartesian2.yScale().maximum(255);
cartesian2.xAxis(0).title("Ort [cm]");
cartesian2.yAxis(0).title("Intensität");
cartesian2.xScroller(true);
cartesian2.xZoom(true);
cartesian2.yAxis(0).labels(false);
cartesian2.xZoom().setToPointsCount(1500,false, null);
cartesian2.xAxis(0).labels().format("{%Value}{decimalsCount:2}");
brightplot.setHorizontalScrollBarEnabled(true);
brightplot.setVerticalScrollBarEnabled(true);
brightplot.setZoomEnabled(true);
brightplot.setChart(cartesian2);
brightplot.setVisibility(View.VISIBLE);
【问题讨论】:
标签: java android number-formatting decimalformat anychart