Smartie Posted September 15, 2010 Report Share Posted September 15, 2010 Hey, I'm having trouble setting the colours of "series" on a pie chart. I currently have a bar chart which I simply loop through the series, if a series name matches a certain value I set the series colour manually. I would like to do the same when the users chooses to output the chart as pie instead of bar. It still runs that code, and sets the series colours but it has no effect on the output of the chart as the pie chart "series" are not the same. So I though I would try looping through the points on my chart, assuming they were the new "series" but it says I have no points. Chart.Point.Count is 0. Please advise me how to loop through and change the colour of the "series" on a pie chart. Thank you. Quote Link to comment Share on other sites More sharing options...
Frank Posted September 21, 2010 Report Share Posted September 21, 2010 Onse series corresponds to a whole pie. Since each Pie slice is colored independently, the series color is not what will affect it. To change the color of a pie slice you can set: chart.Points[pointIndex].Color = myColor; if you want to share the same color for the ith slice of every series, or chart.Points[seriesIndex,pointIndex].Color = myColor; if you don't. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.