Charts: PieChartDataSet no slice space shown when an entry has 0 value

Created on 27 Oct 2016  路  5Comments  路  Source: danielgindi/Charts

Hi,

I noticed something while using this awesome library!
Im using the pie chart and sometimes when I'm showing some data one of the entries will have a 0 value. I also have a set slice space as I quite like the look of it however when an entry as a 0 value the pie chart then ends up looking this:
screen shot 2016-10-27 at 10 10 41

However if all the entries do have a value above 0 it ends up showing the desired slice space:
screen shot 2016-10-27 at 10 10 46

Am I missing something? Or is this intended? If so is there a way to still display a slice space when an entry has an empty value?

I know I could not add the entry to the data set but then I want to make sure the colour is set specifically for each segment. However when the number of entries changes the colour chosen for a segment is different. I can't seem to understand how it decides which pie chart segment gets which colour from the colours array.

Thanks again for any answers :)

bug

All 5 comments

Sounds like a bug to me

Actually it's a feature that removes spacing when it won't fit or would cause weird looks. 0 value will cause double spacing with no value (which you specifically might want...), and an overly crowded pie with 30 values may have no space for slice spacing.

We need to make this an opt-in feature in my opinion, and default to false. Let the user decide and have more control.

I see yeah the reasoning behind it makes sense.

I agree making it an opt-in feature would be great.

(Actually, actual 0 values will not generate extra slice spacing, as they are being ignored for rendering. But it's possible to have almost-invisible values which generate slice spacing)

Done

Was this page helpful?
0 / 5 - 0 ratings