开发者

pchart pie chart legend and graph not correlating

开发者 https://www.devze.com 2022-12-23 03:56 出处:网络
I have 开发者_C百科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

I have 开发者_C百科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 there is 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


just strip down zero values before creating the chart. in other words, create the chart only with valid values.

0

精彩评论

暂无评论...
验证码 换一张
取 消