[MS Chart] How to Find the maximum or minimum Y value and set different colors
MS Chart also has a very bad, simple and easy to use function, sometimes in the Programming System, need to find the most or least value, and set the unique color feature so that the two tables can be seen at once.
Original region:
Although I can see it again, it is not very immediate. It would be nice if I could use different colors.
In this case, is it easier to see the highest, the lowest, and how to do this effect? In fact, it is not enough.
1 |
chart1.DataSource = new DataInfo().GetDataTable(); |
3 |
// The maximum value is set to colors. |
4 |
chart1.Series[0].Points.FindMaxByValue().Color = System.Drawing.Color.Red; |
5 |
//// The straight line of the minimum value is set to black. |
6 |
chart1.Series[0].Points.FindMinByValue().Color = System.Drawing.Color.Black; |
Series. Points. FindMaxByValue () and Series. Points. FindMinByValue () can quickly find the maximum and minimum value. It is really convenient to have this Function ~