Change Pie Chart Color Series

2 posts, 0 answers
  1. Gabriel
    Gabriel avatar
    4 posts
    Member since:
    Jan 2013

    Posted 22 Jul 2013 Link to this post

    I am using Q1 2013 (before the addition of the CategorySeriesItem class, etc.) and am wondering if there is a method equivelant to http://www.telerik.com/help/aspnet-ajax/htmlchart-application-using-multiple-custom-colors.html for my situation.
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 25 Jul 2013 Link to this post

    Hello Gabriel,

    Depending on the RadHtmlChart's implementation you can use the following approaches:
    • For programmatically created series items you can use the logic from the Using Multiple Custom Colors to Create Charts help article - create a static class that holds the colors, so that it can be iterated over to return the desired color according to their indexes - the index of the series can point to the index of its color.
    • For a databound chart you can create an additional column in the datasource that will store the colors for the series. Then you can use the ColorField property for each series type, in order to reference this field/column. Such an example is illustrated in this demo.

    Note also that since Q2 2013 SP1 RadHtmlChart has 10 built-in colors for the series for each skin.



    Regards,
    Danail Vasilev
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top