在创建微软图表自定义调色板 [英] Creating a custom palette in microsoft charting

查看:393
本文介绍了在创建微软图表自定义调色板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来创建自己的图表的调色板中,我可以指定我自己的颜色?

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

这可从的那些

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

真的不适合在与我们的设计,所以创建我自己的将是很好,如果这是可能的感谢!

do not really fit in with our design, so creating my own would be nice if this is possible thanks!

推荐答案

您可以用图表的PaletteCustomColors集合定义自己的调色板。

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;

注:绑定图表数据的的设置数据点颜色

这篇关于在创建微软图表自定义调色板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆