Reputation: 61
I was wondering if someone could please show me sample code for setting the line colour in an MSChart using C#.
I know I can select a scheme form the options but I was wanting to pick my own colours for the different serie's I have shown.
Thank in advance
Upvotes: 3
Views: 8383
Reputation: 1
This answer applies to charts from Microsoft.Office.Interop.Graph.Chart
:
Chart1.SeriesCollection(1).Border.Color = Color.Orange;
Upvotes: 0
Reputation: 449
If you are more used to hex colors:
chart1.Series["MySeries"].Color = System.Drawing.ColorTranslator.FromHtml("#001122");
Upvotes: 0
Reputation: 9340
Chart1.Series["MySeries"].Color = System.Drawing.Color.FromArgb(113, 152, 203);
Upvotes: 5