开发者

How do I set the line colour in an MSChart?

I was wondering if someone could please show开发者_如何学JAVA 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


Chart1.Series["MySeries"].Color = System.Drawing.Color.FromArgb(113, 152, 203);


If you are more used to hex colors:

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


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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜