pchart pie chart legend and graph not correlating

扶醉桌前 提交于 2019-12-25 04:50:44

问题


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 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


回答1:


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



来源:https://stackoverflow.com/questions/2473021/pchart-pie-chart-legend-and-graph-not-correlating

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!