Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show percentages on slices of pie chart with ZingChart

Tags:

zingchart

On this page: http://www.zingchart.com/docs/chart-types/pie/

many of the example pie charts show the percentage on each slice. But I cannot recreate this. How do you show the percentage ON each slice. Note that I also separately will have text that is connected to each slice but outside of it, which acts as a label for each slice using the "text" attribute.

like image 714
Mark Salamon Avatar asked Dec 13 '25 14:12

Mark Salamon


1 Answers

My approach to this question would be to use the default ZingChart settings for your pie chart. That means the value boxes with percentages would appear on the slices by default.

This also means you will have tooltips by default. You can update the tooltips to contain your text. The documentation on how to do this can be found at http://www.zingchart.com/docs/chart-types/pie/#pie__custom_tooltips

The cool part about this is you can include MORE info, such as the absolute values in addition to the percentages.

I also see from one of your past questions that you are using several small pie charts in your visualization. Tooltips will help ensure the readability of your charts in this case, as well.

Note, I am on the ZingChart team. Please let me know if you need additional clarification on this answer.

like image 145
Merrily Avatar answered Dec 16 '25 15:12

Merrily