pie chart color should change for each and every series

Thread is closed for posting
2 posts, 1 answers
  1. Gokul
    Gokul avatar
    11 posts
    Member since:
    Apr 2013

    Posted 14 May 2013 Link to this post

      I'm Having Pie Chart by using stored procedure i will bind the values in chart for that chart series i want to change color (i have 5 series)
       for every series the color should vary.
  2. Answer
    Rosko avatar
    137 posts

    Posted 17 May 2013 Link to this post

    Hi Gokul,

    I hope I understand this right -- for each pie series you want to have different set of colors. What you need to do is to iterate through each item in each series.

    ChartSeries series1 = new ChartSeries();
    series1.Type = ChartSeriesType.Pie;
    series1.AddItem(120, "Internet");
    series1.AddItem(140, "Retail");
    series1.AddItem(35, "Wholesale");
    Color[] colors = (new Color[3]
    for (int i = 0; i < series1.Items.Count; i++)
        series1.Items[i].Appearance.FillStyle.MainColor = colors[i];

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top