Hi, I have a chart in a view that I would like to use to display 3 different types of data in different instances of the view ...so in one instance the view may be displayed to show Commission and in another scenario the view may be used to display "Volume" etc... I have one view which represents the chart and a view model that is used to define the data item to display (among other things) ...I would basically like to set one of the item mappings at runtime (but obviously I am using MvvM).
This is my series definition
and I was hoping to be able to do this (where the DataFieldName would be set in the view model depending on what that particular view instance should show
I get an error in Visual Studio, something about a null value. I have tried a number of options for the binding but it doesn't seem to work so maybe it's not possible
My question is should I be able to do this and if not do you have any suggestions on how to achieve what I am trying to do.
Thanks in advance
This is my series definition
<telerik:SeriesMapping> <telerik:SeriesMapping.SeriesDefinition> <telerik:PieSeriesDefinition LegendDisplayMode="DataPointLabel" ShowItemLabels="False" ShowItemToolTips="True"> <telerik:PieSeriesDefinition.Appearance> <telerik:SeriesAppearanceSettings ></telerik:SeriesAppearanceSettings> </telerik:PieSeriesDefinition.Appearance> </telerik:PieSeriesDefinition> </telerik:SeriesMapping.SeriesDefinition> <telerik:ItemMapping DataPointMember="YValue" FieldName="Commission" /> <telerik:ItemMapping DataPointMember="LegendLabel" FieldName="Symbol" /> </telerik:SeriesMapping>
and I was hoping to be able to do this (where the DataFieldName would be set in the view model depending on what that particular view instance should show
<telerik:ItemMapping DataPointMember="YValue" FieldName="{Binding ElementName=radChart1, Path=DataContext.DataFieldName}" />
I get an error in Visual Studio, something about a null value. I have tried a number of options for the binding but it doesn't seem to work so maybe it's not possible
My question is should I be able to do this and if not do you have any suggestions on how to achieve what I am trying to do.
Thanks in advance