Hi,
I'm trying to use the feature of multiple data sources in the RadChart.
Like this:
XAML:
<
telerik:RadChart
x:Name
=
"Chart1"
>
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMappingCollection
>
<
telerik:SeriesMapping
x:Name
=
"Series1"
ItemsSource
=
"{Binding Data[0]}"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:LineSeriesDefinition
/>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
FieldName
=
"Date"
DataPointMember
=
"XValue"
/>
<
telerik:ItemMapping
FieldName
=
"Value"
DataPointMember
=
"YValue"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
<
telerik:SeriesMapping
x:Name
=
"Series2"
ItemsSource
=
"{Binding Data[1]}"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:LineSeriesDefinition
/>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
FieldName
=
"Date"
DataPointMember
=
"XValue"
/>
<
telerik:ItemMapping
FieldName
=
"Value"
DataPointMember
=
"YValue"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
</
telerik:SeriesMappingCollection
>
</
telerik:RadChart.SeriesMappings
>
</
telerik:RadChart
>
If the Property "Data" is loaded in the constructor of my ViewModel-Class everything works well. But as soon as the Data is loaded after setting the UserControls DataContext (Button-Command), there will raise a NullReferenceException at a point that is not comprehensible to me.
ViewModel:
Hope you could give me a hint how to get this working.
I created a sample project where the "bug" happens. I'd like to send you the VS-Project as a source where you can understand what my problem is. (The project is mostly the code above)
The same problem happens also in WPF-RadChart. We recognized that while a workmate tried to implement your chart in a WPF-Project.
Regards,
Julian