How to set different values for Legend and Labels in piechart While I am using Chart Engine in android

匆匆过客 提交于 2019-12-04 04:20:14

问题


Hi I am using A chart Engine to display pie chart in android.In my code I want to show values on labels and area corresponding to that vale on legend.But I am unable to get that one.Please can any one helps to me.Thanks in advance.

I want like below


回答1:


Displaying the pie labels with separate values from the legend labels is not possible in AChartEngine.

However, you can display the pie slice value (age in your case) in the middle of each slice, using:

renderer.setDisplayChartValues(true);

There was a bug in the code that was preventing displaying the chart values when the labels were not displaying. I have just fixed this issue in SVN. You can checkout the code according to this page and run an ant dist in order to build an up to date achartengine.jar file including this fix.




回答2:


I was also having the same problem but now its solved. Thanks dan...

You can use

renderer.setDisplayValues(true);

This displays the %of distribution in the pie chart itself.



来源:https://stackoverflow.com/questions/13657432/how-to-set-different-values-for-legend-and-labels-in-piechart-while-i-am-using-c

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