How can i change the bar chart color after I click a button?
Here is the senario. I have a bar chart to show line progress. Here is the 3 condition for the bar chart:
1) Before the bar chart reach maximum limit, the color will set to blue.
2) When the bar chart reach maximum limit, the color will set to red.
3) When someone fill in countermeasure form in another page and click button submit, the bar chart will change to green.
For the first one, i just set the color in the server-side code :
.Color = Color.DodgerBlue
For the second one, i use Chart1_Customize to change the color when reach maximum limit. For example i set maximum limit to 25.
Private Sub Chart1_Customize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Chart1.Customize For Each dp As DataPoint In Chart1.Series("Wilma").Points If dp.YValues(0) > 25 Then dp.Color = Color.Crimson End If Next End Sub
Now for the third one, how can I change the color to green after the user click a submit button on the second page?