更改饼图的颜色 [英] Changing the color of the pie chart

查看:105
本文介绍了更改饼图的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用MsChartingContol在asp.net中绘制饼图

饼图中的颜色会自动显示.我想更改饼图切片的颜色.请帮助我.以下是我编写的代码.
谢谢


数据集ds = BALCommon.GetDashboard(base.SysId);
ChartEntriewego.Series [& Series1& quot] .ChartType = SeriesChartType.Pie;
ChartEntriewego.DataSource = ds.Tables [0];
字符串数据= ds.Tables [0] .Columns [&"DATA&"].ToString();
字符串值= ds.Tables [0] .Columns [& quot; Value& quot;].ToString();
ChartEntriewego.Series [& Series1& quot;].XValueMember = data;
ChartEntriewego.Series [& Series1& quot] .XValueType = ChartValueType.String;
ChartEntriewego.Series [& Series1& quot] .YValueType = ChartValueType.String;
ChartEntriewego.Series [& Series1& quot] .YValueMembers = value;
ChartEntriewego.Series [& Series1& quot] .YAxisType = AxisType.Primary;
ChartEntriewego.Series [& Series1& quot] .IsVisibleInLegend = true;
ChartEntriewego.DataBind();

Hi
I am using MsChartingContol to draw pie charts in asp.net

the color in the pie charts come automatically. I want to change the color of the slices of pie charts.Please help me..Below is the code that i have written.
Thanks


dataset ds = BALCommon.GetDashboard(base.SysId);
ChartEntriesAdded.Series["Series1"].ChartType = SeriesChartType.Pie;
ChartEntriesAdded.DataSource = ds.Tables[0];
string data = ds.Tables[0].Columns["DATA"].ToString();
string value = ds.Tables[0].Columns["Value"].ToString();
ChartEntriesAdded.Series["Series1"].XValueMember = data;
ChartEntriesAdded.Series["Series1"].XValueType = ChartValueType.String;
ChartEntriesAdded.Series["Series1"].YValueType = ChartValueType.String;
ChartEntriesAdded.Series["Series1"].YValueMembers = value;
ChartEntriesAdded.Series["Series1"].YAxisType = AxisType.Primary;
ChartEntriesAdded.Series["Series1"].IsVisibleInLegend = true;
ChartEntriesAdded.DataBind();

推荐答案

此链接可能对您有帮助...


http://www.codeproject.com/KB/web-image/3dpiechart.aspx


http://www.codeproject.com/KB/graphics/julijanpiechart.aspx
This link may be help to you...


http://www.codeproject.com/KB/web-image/3dpiechart.aspx


http://www.codeproject.com/KB/graphics/julijanpiechart.aspx


这篇关于更改饼图的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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