问题描述
嗨
我正在使用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();
推荐答案
这篇关于更改饼图的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!