如何在饼图中仅显示非零值?

时间:2015-08-25 17:17:38

标签: charts pie-chart mpandroidchart

我正在使用mpandroid图表来显示我的数据。这里我有5个xvals(A,B,C,D,E)。每个xval都有一个yval(2.2,0.0,4.4,5.1,0.0,9.0)。

我想只在饼图上显示非零值。有没有办法做到这一点?

所以我的PieData最终是这样创建的:

PieData d = new PieData(xVals, ds1);

,其中, xvals包含:

0 = "A"
1 = "B"
2 = "C"
3 = "D"
4 = "E"
5 = "entry0"
6 = "entry1"
7 = "entry2"
8 = "entry3"
9 = "entry4"

和,ds1包含:

0 = {Entry@4129} "Entry, xIndex: 0 val (sum): 0.0"
1 = {Entry@4130} "Entry, xIndex: 1 val (sum): 7400.0"
2 = {Entry@4131} "Entry, xIndex: 2 val (sum): 20634.4"
3 = {Entry@4132} "Entry, xIndex: 3 val (sum): 0.0"
4 = {Entry@4133} "Entry, xIndex: 4 val (sum): 60203.52"

0 个答案:

没有答案