3

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.

5
  • Hey Mark, ZingChart team member here. Can you edit the question to include your JSON and build version? Thanks Dec 29, 2015 at 0:02
  • Build 0.141205. { "type":"pie", "series": [ {"values":[59]}, {"values":[55]}, {"values":[30]}, {"values":[28]}, {"values":[15]} ] }; Dec 29, 2015 at 0:38
  • I added the latest version and that fixed it. Dec 29, 2015 at 0:42
  • But now the text attributes are not appearing. :( Dec 29, 2015 at 0:43
  • The text attributes do appear if I change it to a 3d pie chart, but not for a regular one. This also makes the percentages disappear, however. Dec 29, 2015 at 0:59

1 Answer 1

4

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.

2
  • Thanks. The issue is that I was using a very old build of ZC. Updating to the latest build fixed the issue, but did cause the text labels on each slice to disappear, unless I changed it to a 3d pie chart. It seems odd that 3d pie charts would have different behavior. Dec 29, 2015 at 1:00
  • I think it is because you can change the view angle on the 3D pie charts, so labels make more sense than on-slice value boxes in certain cases there. Glad it worked!
    – Merrily
    Dec 29, 2015 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.