[MS Chart] How to Find the maximum or minimum Y value and set different colors

Source: Internet
Author: User
[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();
2 chart1.DataBind();
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 ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.