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

Chart randomly skipping data.

1 Answer 51 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 14 Oct 2010, 01:29 AM
Hi guys,

I'm evaluating RadControls and the chart is giving me grief. 
The data is pretty simple (attached).
Here is my XAML:

 <rad:RadChart Margin="20,20,0,0" Height="250" HorizontalAlignment="Stretch" x:Name="StatusChart" Grid.Column="2" >

Here is my code:
     
            SeriesMapping seriesMapping1 = new SeriesMapping();
            seriesMapping1.GroupingSettings.ShouldCreateSeriesForLastGroup = true;
            seriesMapping1.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor("JobStatusDesc"));
            seriesMapping1.ItemMappings.Add(new ItemMapping("MonthTotal", DataPointMember.YValue));
            seriesMapping1.ItemMappings.Add(new ItemMapping("StatusMonth", DataPointMember.XCategory));
            
            MonthlyTotalsChart.SeriesMappings.Add(seriesMapping1);
            MonthlyTotalsChart.ItemsSource = MonthlyData;

Fairly straightforward, but the chart (attached) skips a lot of the data! The data it does show is correct, but 201006 should also show a Raised value of 1, 201007 should show Raised, Cancelled and On Site values. One of the months (201008) isn't there at all, and 201009 is likewise missing values. No value above 5 is shown at all, but the chart seems to allocate space for the extra bars in the graph.

What gives?

1 Answer, 1 is accepted

Sort by
0
Steven
Top achievements
Rank 1
answered on 15 Oct 2010, 06:23 AM
Figured it out. It wasn't related to the chart. It was because the Entity Framework was using a view that had no unique ID field.
Tags
Chart
Asked by
Steven
Top achievements
Rank 1
Answers by
Steven
Top achievements
Rank 1
Share this question
or