eclipse中GraphView的Y轴可以设置为2位小数吗
Can Y Axis on GraphView in eclipse be set to 2 decimal places
GraphViewData[] data = new GraphViewData[numElements];
for (int c = 0; c<numElements; c++) {
data[c] = new GraphViewData(c+1, pvalueArray[c]);
}
GraphView graphView = new LineGraphView(this, Captionname);
GraphViewSeries graphViewSeries = new GraphViewSeries(data);
我正在填充上面的图表,我的数组包含设置为小数点后两位的值。
当我在我的应用程序上使用图表时,Y 轴上升到小数点后 3 位。我可以强制它为 2 吗?
我使用的是 3.1.3 版本。我真的不想升级并且不得不更改大量代码。
如何使用 DefaultLabelFormatter? - 抱歉,我是新手,无法添加评论!
我必须升级到版本 4 然后才能使用
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumFractionDigits(1);
nf.setMinimumIntegerDigits(2);
graph.getGridLabelRenderer().setLabelFormatter(new DefaultLabelFormatter(nf, nf));
现在卡在如何从我的数组中添加数据了!!!
GraphViewData[] data = new GraphViewData[numElements];
for (int c = 0; c<numElements; c++) {
data[c] = new GraphViewData(c+1, pvalueArray[c]);
}
GraphView graphView = new LineGraphView(this, Captionname);
GraphViewSeries graphViewSeries = new GraphViewSeries(data);
我正在填充上面的图表,我的数组包含设置为小数点后两位的值。
当我在我的应用程序上使用图表时,Y 轴上升到小数点后 3 位。我可以强制它为 2 吗?
我使用的是 3.1.3 版本。我真的不想升级并且不得不更改大量代码。
如何使用 DefaultLabelFormatter? - 抱歉,我是新手,无法添加评论!
我必须升级到版本 4 然后才能使用
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumFractionDigits(1);
nf.setMinimumIntegerDigits(2);
graph.getGridLabelRenderer().setLabelFormatter(new DefaultLabelFormatter(nf, nf));
现在卡在如何从我的数组中添加数据了!!!