Click here to Skip to main content
15,894,312 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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();
Posted

1 solution

This link may be help to you...


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


http://www.codeproject.com/KB/graphics/julijanpiechart.aspx
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900