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

Customize Pie Chart

2 Answers 103 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Grtjn
Top achievements
Rank 1
Grtjn asked on 04 Mar 2010, 10:52 AM
I just created a Pie Chart using data from a database (using webservices).
For this i retrieved the data and put in a List.

PieDataList

 

PieResult = new PieDataList();

 

 

while (reader.Read())

 

{

PieResult.Add(

new PieData {Naam = reader["Name"].ToString(),Percentage = Convert.ToInt32(reader["Value"])});

 

 

}

Later I make sure my data is shown in a Pie Chart.

 

SeriesMapping

 

sm = new SeriesMapping();

 

sm.ItemMappings.Add(

new ItemMapping("Percentage", DataPointMember.YValue));

 

sm.ItemMappings.Add(

new ItemMapping("Naam", DataPointMember.LegendLabel));

 

 

PieChart1.SeriesMappings.Add(sm);

PieChart1.DefaultSeriesDefinition =

new PieSeriesDefinition() { ShowItemLabels = false };

 

PieChart1.ItemsSource = e.Result;

 

How can I now change the color of one particular object in my list?
And is it possible to show the values of my objects (Percentage) in the chart?

Kind regards,

Gj

2 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 08 Mar 2010, 12:48 PM
Hi GJ DM,

Currently there is no way of changing the color of a particular object (if by object you mean pie slice). In the Q1 2010 version, which is to be released in a couple of days, we did rework the RadChart styling to allow easy color customizations.

For the object values, please, review the Format Expressions help topic.

All the best,
Joshua
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Grtjn
Top achievements
Rank 1
answered on 08 Mar 2010, 01:30 PM
Ok,

Thanks for the reply !

Gj
Tags
Chart
Asked by
Grtjn
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Grtjn
Top achievements
Rank 1
Share this question
or