How to set line color in MSChart?

I was wondering if anyone could show me a sample code to set the line color in MSChart using C #.

I know that I can choose the shape of the form, but I wanted to choose my own colors for the different series that I showed.

thanks in advance

+3
source share
3 answers
Chart1.Series["MySeries"].Color = System.Drawing.Color.FromArgb(113, 152, 203);
+4
source

If you are more used to hex colors:

chart1.Series["MySeries"].Color = System.Drawing.ColorTranslator.FromHtml("#001122");
0
source

This answer applies to diagrams from Microsoft.Office.Interop.Graph.Chart:

Chart1.SeriesCollection(1).Border.Color = Color.Orange;
0
source

All Articles