开发者

Creating a custom palette in microsoft charting

开发者 https://www.devze.com 2023-01-16 09:42 出处:网络
Is there a way to create my own charting palette in which I can specify my own colors? The ones that are available from

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

精彩评论

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

关注公众号