Hi, I have just downloaded the latest trial code and I am experiencing some problems getting data to bind to a chart.
I have setup a WPF Service which delivers data and the data is coming across to the codebehind without issue.
When I try to bind that data to my chart I get a null exception.
Stack Trace
at Telerik.Windows.Controls.Charting.DataBindingHelper.AssignMappingFieldTypes(QueryableCollectionView dataEngine, SeriesMapping seriesMapping) at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessNoGrouping(SeriesMapping seriesMapping, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition, AxisRangeState axisXRangeState, Int32 seriesCount) at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessMapping(SeriesMapping seriesMapping, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition, AxisRangeState axisXRangeState, Int32 seriesCount) at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessMappings(SeriesMappingCollection seriesMappings, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition, AxisRangeState axisXRangeState) at Telerik.Windows.Controls.Charting.DataBindingHelper.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ISeriesDefinition defaultSeriesDefinition, ChartFilterDescriptorCollection globalFilterDescriptors, ChartSortDescriptorCollection globalSortDescriptors, SamplingSettings samplingSettings, ZoomScrollSettings zoomScrollSettings, AxisRangeState axisXRangeState) at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea) at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData) at Telerik.Windows.Controls.RadChart.Rebind(Object originalData) at Telerik.Windows.Controls.RadChart.ItemsSourcePropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs args) at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.
My Code
void proxy_GetStatsCompleted(object sender, ServiceReference1.GetStatsCompletedEventArgs e)
{
var seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = "User Types";
seriesMapping.SeriesDefinition = new BarSeriesDefinition();
var ymap = new ItemMapping("count", DataPointMember.YValue);
var xmap = new ItemMapping("name", DataPointMember.XValue);
seriesMapping.ItemMappings.Add(ymap);
seriesMapping.ItemMappings.Add(xmap);
myChart.SeriesMappings.Add(seriesMapping);
myChart.ItemsSource = e.Result;
}
Can anyone suggest why this problem is happening. We really like the Silverlight charts but unless we can bind data dynamically from our database there is no point in using them.
Please advise
G
I have setup a WPF Service which delivers data and the data is coming across to the codebehind without issue.
When I try to bind that data to my chart I get a null exception.
Stack Trace
at Telerik.Windows.Controls.Charting.DataBindingHelper.AssignMappingFieldTypes(QueryableCollectionView dataEngine, SeriesMapping seriesMapping) at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessNoGrouping(SeriesMapping seriesMapping, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition, AxisRangeState axisXRangeState, Int32 seriesCount) at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessMapping(SeriesMapping seriesMapping, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition, AxisRangeState axisXRangeState, Int32 seriesCount) at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessMappings(SeriesMappingCollection seriesMappings, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition, AxisRangeState axisXRangeState) at Telerik.Windows.Controls.Charting.DataBindingHelper.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ISeriesDefinition defaultSeriesDefinition, ChartFilterDescriptorCollection globalFilterDescriptors, ChartSortDescriptorCollection globalSortDescriptors, SamplingSettings samplingSettings, ZoomScrollSettings zoomScrollSettings, AxisRangeState axisXRangeState) at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea) at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData) at Telerik.Windows.Controls.RadChart.Rebind(Object originalData) at Telerik.Windows.Controls.RadChart.ItemsSourcePropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs args) at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.
My Code
void proxy_GetStatsCompleted(object sender, ServiceReference1.GetStatsCompletedEventArgs e)
{
var seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = "User Types";
seriesMapping.SeriesDefinition = new BarSeriesDefinition();
var ymap = new ItemMapping("count", DataPointMember.YValue);
var xmap = new ItemMapping("name", DataPointMember.XValue);
seriesMapping.ItemMappings.Add(ymap);
seriesMapping.ItemMappings.Add(xmap);
myChart.SeriesMappings.Add(seriesMapping);
myChart.ItemsSource = e.Result;
}
Can anyone suggest why this problem is happening. We really like the Silverlight charts but unless we can bind data dynamically from our database there is no point in using them.
Please advise
G