I am trying to display the MaterialName values in the Legend...
The Chart controls creates a line for each MaterialName in the list but I cannot get the Legend to display those names...
All the examples I found use static Legend captions.
I am using this ItemSource:
This is the XAML code:
The Chart controls creates a line for each MaterialName in the list but I cannot get the Legend to display those names...
All the examples I found use static Legend captions.
I am using this ItemSource:
public class ForecastValue { public string MaterialName { get; set; } public double Period { get; set; } public double Quantity { get; set; } } This is the XAML code:
<telerik:RadChart x:Name="EquipmentDistribution" ItemsSource="{Binding ForecastValueList}" > <telerik:RadChart.DefaultView > <telerik:ChartDefaultView > <telerik:ChartDefaultView.ChartLegend> <telerik:ChartLegend DisplayMemberPath="MaterialName" /> </telerik:ChartDefaultView.ChartLegend> <telerik:ChartDefaultView.ChartArea> <telerik:ChartArea OverridesDefaultStyle="False" EnableAnimations="False"> <telerik:ChartArea.AxisY> <telerik:AxisY Title="Quantity"/> </telerik:ChartArea.AxisY> <telerik:ChartArea.AxisX> <telerik:AxisX Title="Periods"/> </telerik:ChartArea.AxisX> </telerik:ChartArea> </telerik:ChartDefaultView.ChartArea> </telerik:ChartDefaultView> </telerik:RadChart.DefaultView> <telerik:RadChart.SeriesMappings> <telerik:SeriesMapping LegendLabel="MaterialName"> <telerik:SeriesMapping.SeriesDefinition> <telerik:LineSeriesDefinition LegendDisplayMode="SeriesLabel" /> </telerik:SeriesMapping.SeriesDefinition> <telerik:ItemMapping DataPointMember="LegendLabel" FieldName="MaterialName"/> <telerik:ItemMapping DataPointMember="XValue" FieldName="Period"/> <telerik:ItemMapping DataPointMember="YValue" FieldName="Quantity" /> </telerik:SeriesMapping> </telerik:RadChart.SeriesMappings> </telerik:RadChart>