简体   繁体   English

如何传递x和y轴值以在Android中创建条形图?

[英]How to pass x and y axis values for creating a bar-chart in android?

How to pass the x-axis and y-axis values to the bar-chart for creating a bar-chart in android.Here i preferred AchartEngine method for creating a bar-chart in android. 如何将x轴和y轴值传递到条形图以在android中创建条形图。这里,我更喜欢AchartEngine方法在android中创建条形图。

But the problem is, i am getting the those values ie. 但是问题是,我正在获取那些值,即。 x and y-axis values from the web service.I have successfully consumed these values but i am unable to pass those values to the bar-chart. Web服务的x和y轴值。我已成功使用了这些值,但无法将这些值传递到条形图。 How to do this? 这个怎么做? suggestions please. 建议。

Thanks in advance!.. 提前致谢!..

instead of using int[] series use 代替使用int[] series使用

 static ArrayList<Integer> series = new ArrayList<Integer>();

and update this series using ur values taken from web service. 并使用从网络服务获取的ur值更新此系列。

like if u collect web service valuse in a int[] webseries 就像您是否在int[] webseries收集Web服务值

for (int i =0; i< webseries.Lenght; i++)
{ 
 series.add(webseries[i]); //series.add(newvlue);
}

and then repaint every time u add data it ll be dynamically updating as and when data available 然后在每次添加数据时重新绘制,它将在数据可用时动态更新

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM