I have a simple object that contains a list of status names and their respective counts. I need to display a pie or doughnut chart with the legend showing each status. However, I'm having trouble doing this through the backend code. My logic as follows:
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.SeriesDefinition =
new DoughnutSeriesDefinition();
ItemMapping itemMapping = new ItemMapping();
itemMapping.DataPointMember =
DataPointMember.LegendLabel;
itemMapping.FieldName =
"Status";
seriesMapping.ItemMappings.Add(itemMapping);
this.charWorkOrderTypes.SeriesMappings.Add(seriesMapping);
this.charWorkOrderTypes.ItemsSource = myData;
this.charWorkOrderTypes.DefaultView.ChartArea.Extensions.Add(new CameraExtension());
I'd really appreciate some assistance with this code. Also, ideally, I'd prefer to bind everything through the XAML. If you could provide an example of that using my test scenario I'd greatly appreciate it.
Regards,
Seth