显示使用aChartEngine在饼图的%ofDistribution [英] Displaying the %ofDistribution in PieChart using aChartEngine

查看:126
本文介绍了显示使用aChartEngine在饼图的%ofDistribution的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Andr​​oid应用程序创建一个饼图。 此链接使用achartengine帮助。但我仍然有一个问题。我想饼图本身显示分配%

I am trying to create a Piechart in my android app. this link using achartengine helped. But I still have a problem. I want to display the % of distribution in the pie chart itself

先谢谢了。

推荐答案

我也一直在寻找相同的。但见丹<一给出了答案href=\"http://stackoverflow.com/questions/13657432/how-to-set-different-values-for-legend-and-labels-in-piechart-while-i-am-using-c\">here.我想他是背后的AChartEngine的家伙,他说,传说和标签的名称不能是不同的。

I was also looking for the same. But see the answer given by Dan here. I suppose he is the guy behind AChartEngine and he says that the names of legends and Labels cannot be different.

更新:

虽然我做了什么,以你过来吧,这是,我把传说大小为0。然后在我的标签设置标签和计算百分比在一起。所以,你的情况,标签会变成是:

Although what I did to over come this was, that I made the legend size as 0. Then in the label I set the label and the computed percentage together. So, in your case, the labels would turn out to be:

镁+ 23%

Na +的45%......等等。

Na+ : 45% ...so on.

更新:2

这在1.0.0和版本问题为present已经解决了在最新版本1.1.0-RC2版本。您可以从这里下载。现在,作为@丹说,<一个href=\"http://stackoverflow.com/questions/13657432/how-to-set-different-values-for-legend-and-labels-in-piechart-while-i-am-using-c/15471237#15471237\">here,我们可以有不同的传说和标签值。我们也可以使用:

This issue for present in version 1.0.0 and has been solved in the latest version 1.1.0-rc2 version. You can download it from here. Now as @Dan says it here, we can have different Legend and Label values. We can also use:

renderer.setDisplayValues(true);

要显示饼图本身的分布比例。

to displays the percentage distribution in the pie chart itself.

这篇关于显示使用aChartEngine在饼图的%ofDistribution的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆