开发者

Highlight one column in Asp.net Chart Control Series

开发者 https://www.devze.com 2022-12-16 14:06 出处:网络
Any help or pointers would be great on this, I\'m going through the ASP.NET chart controls WebSamples project but I haven\'t found what I\'m looking for yet. So basically if I had a standard bar chart

Any help or pointers would be great on this, I'm going through the ASP.NET chart controls WebSamples project but I haven't found what I'm looking for yet. So basically if I had a standard bar chart with data such as below:

John - 68%
Fred - 75%
Mary - 开发者_C百科32%
Anne - 88%

Displaying it in one series with names as the x axis and percentages as the y, is there anyway to change or highlight the bar colour of just one, so say all the bars in the series are blue but I want to programmatically change mary's bar colour to red. Is this possible?


Right, well I've found a colution to this, if anyone has a neater solution then please post it. If you can find out the index of the bar by looping through your data or however then you can set the bar color as below.

myChart.Series[0].Points[theColumnIndex].Color = System.Drawing.Color.Red;
0

精彩评论

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

关注公众号