how to create a bar graph in android? [duplicate]

匿名 (未验证) 提交于 2019-12-03 08:46:08

问题:

This question already has an answer here:

I have a requirement to create a horizontal bar graph that shows comparison between two values. So I need to create only two horizontal bars, first one is for total amount and second one is for consumed amount.

could some one please help me with suggestions to create a bar chart in android. I look forward to hearing from you at the earliest.

Thanks in advance

回答1:

Just check this Bar Chart in Android With out any Built in jars. Here you can draw charts without any built in jars. Its just simple Graph creation using the concept of setting the height for the textview in a ListView.

I implemented this by using the Horizontal ListView. Here you have the two double arrays with equal size of elements. And the graph will adjust according to the orientation(Portrait and landscape).

If you want more charts in one activity, you can implement another Horizontal Listview in the layout.

I hope this will help you....



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!