Home Forums Chart Support Pie chart index label for 0

Pie chart index label for 0

Viewing 5 posts - 1 through 5 (of 5 total)
  • #12411


    I am using pie chart. For partitions where data is 0, it shows 0%. Can we hide 0% where data is 0 and only show ones which have data?




    You can use indexLabelFormatter to achieve this. Please check this jsfiddle.


    Hi Vishwas,

    But this one displays exact y value rather than percentage.

    I think (indexLabel: “#percent%”) is overridden by indexLabelFormatter.

    • This reply was modified 7 years, 2 months ago by Navinder.


    Please refer to indexLabelFormatter documentation. You can use dataSeries, datapoint, index, total, percent, chart within indexLabelFormatter function. So when y-value is not 0, returning e.percent will fulfill your requirement. Here is the updated jsfiddle.


    I have been able to achieve it with the help of e.total.

    Thanks for your help.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.