Search code examples
androidchartspie-chartandroidplot

Pie Chart 100% with androidplot


i have this pie chart in my app:

Segment seg0 = new Segment(" ", pgan);
Segment seg1 = new Segment(" ", pper);
Segment seg2 = new Segment(" ", pemp);

graficoPartidos.addSeries(seg0, new SegmentFormatter(Color.rgb(106, 168, 79), Color.BLACK,Color.BLACK, Color.BLACK));

graficoPartidos.addSeries(seg1, new SegmentFormatter(Color.rgb(255, 0, 0), Color.BLACK,Color.BLACK, Color.BLACK));

graficoPartidos.addSeries(seg2, new SegmentFormatter(Color.rgb(255, 153, 0), Color.BLACK,Color.BLACK, Color.BLACK));

where pgan, pper and pemp are Integers. If two of that numbers are 0, then the pie chart doesnt show anything and it suppose to show a full pie chart.

https://i.sstatic.net/ywIYP.png

enter image description here

Any suggestion?


Solution

  • Don't worry, your code is fine.

    It's just a bug in androidplot. At least in the last version - 0.6.0. It was fixed several months ago and will be included in the next release, I suppose.

    Anyway, if you don't want to wait for that to happen, just go here, download latest development version, which, as for now, is Androidplot 0.6.1 and replace your old library jar with the new one.

    After that it should work:

    enter image description here