programmically change color of pie slices

2 posts, 0 answers
  1. Javid
    Javid avatar
    2 posts
    Member since:
    Oct 2011

    Posted 22 Oct 2011 Link to this post

    Hello,

    I'm using pie chart and I wanna change the color of each slice according to some data related to slice.
    The color will be calculated from a formula.

    how can I change the color of slices through C# code at run-time ?

    how can I do something like this pseudo :

    pieChart.Slice[0].Fill = Claculate_The_Color_From_Data_Of_Slice();
    pieChart.Slice[1].Fill = Claculate_The_Color_From_Data_Of_Slice();
    pieChart.Slice[2].Fill = Claculate_The_Color_From_Data_Of_Slice();
    pieChart.Slice[3].Fill = Colors.Red

    I hope it's clear enough

    thanks in advance :-)


  2. Sia
    Admin
    Sia avatar
    756 posts

    Posted 26 Oct 2011 Link to this post

    Hi Javid,

    Please check the approach described in the following help topic and let us know whether it works for you.

    Greetings,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top