开发者

Creating a custom palette in microsoft charting

Is there a way to create my own charting palette in which I can specify my own colors?

The ones that are available from

  chart.Palette = System.Web.UI.DataVisualization.Charting.ChartColorPalette. //palette

do not real开发者_C百科ly fit in with our design, so creating my own would be nice if this is possible thanks!


You can define your own palette using chart's PaletteCustomColors collection.

chart.PaletteCustomColors.Add(Color.Red);
chart.PaletteCustomColors.Add(Color.Blue);

Also if you need to control a color of each datapoint use the datapoint's color:

chart.Series[0].Points[0].Color = Color.Red;

Note: Bind chart to data before setting the datapoint colors.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜