gpt4 book ai didi

android - achartengine 堆叠条形图的 X 和 Y 图相互重叠?

转载 作者:行者123 更新时间:2023-11-29 02:08:11 25 4
gpt4 key购买 nike

我正在使用 achartEngine 绘制堆叠条形图。我的 X 和 Y 值图重叠,并且绘制的值比另一个值小。下面是我的构建数据集和图表工厂

protected XYMultipleSeriesDataset buildBarDataset(String[] titles, List<double[]> values) {
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
int length = titles.length;
for (int i = 0; i < length; i++) {
CategorySeries series = new CategorySeries(titles[i]);
double[] v = values.get(i);
int seriesLength = v.length;
for (int k = 0; k < seriesLength; k++) {
series.add(v[k]);
}
dataset.addSeries(i,series.toXYSeries());
}
return dataset;
}

我的图表工厂:

mChartView = ChartFactory.getBarChartView(NTViewGraph.this, buildBarDataset(titles, values), renderer,
Type.STACKED);

最佳答案

根据给定的链接:

http://community.developer.motorola.com/t5/MOTODEV-For-Enterprise/Enterprise-Grade-Charts-part-II/ba-p/23420

Use below methods and pass 0 to that methods.
If you set it to 0 then it will not show any label and shows label that is externally set by You. And if you pass 1 then it shows 1 label in the interval of 10.

renderer.setXLabels(0);
renderer.setYLabels(0);

希望对您有所帮助。

关于android - achartengine 堆叠条形图的 X 和 Y 图相互重叠?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8849983/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com