This is a migrated thread and some comments may be shown as answers.

programmically change color of pie slices

1 Answer 63 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Javid
Top achievements
Rank 1
Javid asked on 22 Oct 2011, 10:41 AM
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 :-)


1 Answer, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 26 Oct 2011, 02:19 PM
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 >>

Tags
Chart
Asked by
Javid
Top achievements
Rank 1
Answers by
Sia
Telerik team
Share this question
or