I have been searching with no luck on how to change a bar chart fill color by formula in the new charting controls. I want to change the individual bar color based on the value of the datapoint. The old .rldc reporting allowed for a formula like this to
custom color:
For J As Int16 = 0 To Chart1.Series(0).Points.Count - 1
Select Case Chart1.Series(0).Points(J).YValues(0)
Case Is > 90
Chart1.Series(0).Points(J).Color = Color.Goldenrod
Case 80 To 89
Chart1.Series(0).Points(J).Color = Color.Silver
Case Else
Chart1.Series(0).Points(J).Color = Color.DarkGoldenrod
End Select
Next J
Marked as answer by meekna on Dec 06, 2012 04:58 PM
meekna
Member
74 Points
128 Posts
aspnet 4.0 Charting
Dec 04, 2012 02:31 PM|LINK
I have been searching with no luck on how to change a bar chart fill color by formula in the new charting controls. I want to change the individual bar color based on the value of the datapoint. The old .rldc reporting allowed for a formula like this to custom color:
=IIF((Fields!TotalScore.Value) > 90, "Goldenrod", IIF((Fields!TotalScore.Value) < 80, "DarkGoldenrod", "Silver"))
Any help is appreciated.
meekna
Member
74 Points
128 Posts
Re: aspnet 4.0 Charting
Dec 05, 2012 02:20 PM|LINK
No one has an answer? or is this so simple it doesn't require an answer?
Frank Jiang ...
All-Star
16006 Points
1728 Posts
Microsoft
Re: aspnet 4.0 Charting
Dec 06, 2012 08:10 AM|LINK
Hi,
Check this similar post if any helps:
http://forums.asp.net/t/1638009.aspx/1
http://forums.asp.net/t/1652369.aspx/1
http://www.devtechie.com/post/2011/03/31/Setting-Custom-Color-Palette-in-Pie-Chart-.aspx
Feedback to us
Develop and promote your apps in Windows Store
paindaasp
Star
12070 Points
2034 Posts
Re: aspnet 4.0 Charting
Dec 06, 2012 01:50 PM|LINK
Perhaps this will help:
For J As Int16 = 0 To Chart1.Series(0).Points.Count - 1 Select Case Chart1.Series(0).Points(J).YValues(0) Case Is > 90 Chart1.Series(0).Points(J).Color = Color.Goldenrod Case 80 To 89 Chart1.Series(0).Points(J).Color = Color.Silver Case Else Chart1.Series(0).Points(J).Color = Color.DarkGoldenrod End Select Next Jmeekna
Member
74 Points
128 Posts
Re: aspnet 4.0 Charting
Dec 06, 2012 04:59 PM|LINK
Fantastic! I like the use of codebehind for the new charting
Thanks