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

RadChart Series not displaying correctly

1 Answer 155 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.
Matt
Top achievements
Rank 2
Matt asked on 04 Aug 2011, 02:46 PM
I'm currently attempting to get a simple pie chart working, I have the following data structure returned from my Web Service

public class FeedbackChartData
{
    public string Legend { get; set; }
    public int count { get; set; }
}

I then set up the series mappings as follows:

PieChart.DefaultView.ChartTitle.Content = "Feedback Score Breakdown";
PieChart.DefaultView.ChartArea.SmartLabelsEnabled = true;
 
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition = new PieSeriesDefinition();
seriesMapping.SeriesDefinition.ItemLabelFormat = "N0";
 
seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor("Legend"));
seriesMapping.GroupingSettings.ShouldCreateSeriesForLastGroup = true;
 
ItemMapping yMapping = new ItemMapping("Count", DataPointMember.YValue);
ItemMapping catMapping = new ItemMapping("Legend", DataPointMember.LegendLabel);
 
seriesMapping.ItemMappings.Add(yMapping);
seriesMapping.ItemMappings.Add(catMapping);
 
PieChart.SeriesMappings.Add(seriesMapping);

The pie chart ItemSource is set to a collection of FeedbackChartDataObjects (see above) containing the following data.

{ "Bad", 72 }
{ "Good", 1393 }
{ "Average", 6766 }

When the Pie Chart displays it looks like only 1 series is displayed and the series labels overlap as show in the attached screenshot.

The series also all have the same colour (Green) I would like to be able to either specify the colour it uses or at least have them as different colours.

Thanks in advance 

-Matt

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 09 Aug 2011, 01:19 PM
Hello Matt,

Take a look at this forum post with sample project attached that will help you solve your issue. The mentioned forum post is for WPF but the approach is absolutely the same for Silverlight.

Greetings,
Evgenia
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Tags
Chart
Asked by
Matt
Top achievements
Rank 2
Answers by
Evgenia
Telerik team
Share this question
or