Open bartonmartin opened 8 years ago
I am also facing same issue. Whenever value is 1, that slice becomes invisible. On selection it shows the slice properly. Is there a workaround for this?
Thanks.
@nishantapatil I've temporarily solved this with multiplying all values by a constant number. It's not ideal, but at least the graphs works.
@bartonmartin But multiplying by constant value will affect the data. Which will cause inconsistency moving ahead. I have 3 level deep charts, there in one level down after selecting a slice in above screenshot. Any other hack?
@bartonmartin Found a hack over here : #2329.
The issue for problem 1 is this part in the PieRenderer- // draw only if the value is greater than zero if ((Math.abs(e.getY()) > Utils.FLOAT_EPSILON)) { .... }
Basically now I am checking if ((value >= 1 && value <= Utils.FLOAT_EPSILON) { value = 1.0000002; }
This is still a hack but better than multiplying my constant number. Hope this helps.
Fixed EPSILON. Take pull and rebuild.
@danielgindi Please close this also.
I have a problem with Pie Chart
When I have Pie Chart with three values like on picture above, it never shows the smallest piece. I've tried different value formatters, I've tried changing colors, I've tried all different settings, but nothing helped me so far.
When I hardcode the same value for all the entries - for example "20" then it shows nice equal size, different color pieces.
pie setup method:
`setupPieChart(PieChart pieChart, List pieValues, String title)
{
PieData data = generatePieData(pieValues); SpannableString centerText = generateSpannableCenterText(pieValues, title);
}`
and method for data generation is here:
`generatePieData(List values)
{
List pieEntryList = new ArrayList<>();
.. List colors = new ArrayList<>();
for(int color : context.getResources().getIntArray(R.array.pie_chart_colors))
{
colors.add(color);
}
..
PieDataSet pieDataSet = new PieDataSet(pieEntryList, ""); pieDataSet.setDrawValues(true); pieDataSet.setColors(colors);
}`
colors array: `
Also when I set all the values to "1" this happens.