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

    Hi,

    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?

    Thanks

    #12466

    Navinder,

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

    #12469

    Hi Vishwas,

    But this one displays exact y value rather than percentage.

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

    • This reply was modified 8 years, 2 months ago by Navinder.
    #12471

    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.

    #12472

    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.