pchart pie chart legend and graph not correlating

Posted by madphp on Stack Overflow See other posts from Stack Overflow or by madphp
Published on 2010-03-18T20:07:29Z Indexed on 2010/03/18 20:11 UTC
Read the original article Hit count: 581

Filed under:
|

Hi,

I have ten values in the dataset, numbers 1 - 10 and corresponding values. Some of the values are coming back as zero, so they are not added to the chart, BUT, the legend is still listing 1 - 10. Because theres values missing in the chart, the colour coding is knocked off. ie

Item 1, has a value of zero, its passed over in the chart, the colour in the legend is red, Item 2, has a value of 4, the percentage is calculated, and the chart gives it the colour red which is the colour for item 1 in the legend.

Hope that makes sense.

How can I print the legend just for the values that are displayed in the chart?

--Mark

© Stack Overflow or respective owner

Related posts about php

Related posts about pchart