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

Chart visual states

1 Answer 39 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tonchi91
Top achievements
Rank 1
Tonchi91 asked on 23 Mar 2015, 12:47 AM
Hello,

I am having problems with refreshing Visual state of the Pie Chart.
When I set two values for Pie Chart, I still have the same look, no matter what values I enter from the C# code.

I can only change visual state by changing values from XAML.
My question is, how can I change the visual state by C# code? For example I have green and silver colors for values, and if my First value is 8, and second is 0, Pie Chart should be filled all by green color.

Default values are:
<telerikCharting:PieDataPoint Value="50"/>
<telerikCharting:PieDataPoint Value="50"/>


I am changing values from C# code like this:
PieSeries pieSeries = new PieSeries();
pieSeries.DataPoints.Insert(0, new PieDataPoint() { Value = value1});
pieSeries.DataPoints.Insert(1, new PieDataPoint() { Value = value2});
                         
radPieChart3.Series.Add(pieSeries);


1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 25 Mar 2015, 11:45 AM
Hi Antonio,

The update should happen automatically with no additional code. The code you have provided looks good to me and I do not expect any issues with it, given that you remove the series before adding a new one. Alternatively, you can clear the datapoints and keep the same series. Please, find attached a small example.

Best regards,
Ves
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Chart
Asked by
Tonchi91
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or