react-native-pathjs-charts icon indicating copy to clipboard operation
react-native-pathjs-charts copied to clipboard

Pie chart will not render properly if has 2 items and one of the item has 0 value

Open mochamadArif opened this issue 8 years ago • 3 comments
trafficstars

  • [x] I have searched for existing issues
  • [x] I have provided detailed instructions that can reproduce the issue (including code and data necessary)

It happened to me after generate a chart with 2 items, and one of the item has 0 value. chartData: [{ "labelColor": '#8dc63f', "name": "Label 1", "value": 100 }, { "labelColor": '#134a83', "name": "Label 2", "value": 0 }]

It should render full 100% round of Label 1, but it's not.

mochamadArif avatar Mar 23 '17 06:03 mochamadArif

Agreed this library should handle that edge case better. I guess the best way around this is to add validation to whatever it is generating your data to exclude whatever item comes up with a value of 0.

marzolfb avatar Mar 26 '17 13:03 marzolfb

Yes, I've exclude all 0 value, but it seems that the stroke and inner circle couldn't be removed using the current options. I've create a new issue for this. Thank you.

mochamadArif avatar Apr 05 '17 05:04 mochamadArif

yes this.

let pieData = [
            {"label":"Exellent", "total":1},
            {"label":"Good", "total":0},
            {"label":"Regular", "total":0},
            {"label":"Bad", "total":0}
        ];

CodeXtinction avatar Apr 15 '17 17:04 CodeXtinction