Hello,
I have a radchart that I wish to add x series to dynamically depending on what you check off in a checkbox list.
I have a RadChart declared like this:
My ChartSeriesMapping is declaredl like this:
I'm adding series like this:
Where ChartData is containing XValue and YValue public properties.
But the charts is always empty when I'm adding new series... How is this supposed to work? Also, how come legend Label is always set to Series 0, Series 1, etc?
Thanks in advance.
I have a radchart that I wish to add x series to dynamically depending on what you check off in a checkbox list.
I have a RadChart declared like this:
<
telerik:RadChart
x:Name
=
"radChart"
telerik:StyleManager.Theme
=
"Metro"
SeriesMappings
=
"{Binding ChartSeriesMapping}"
>
</
telerik:RadChart
>
My ChartSeriesMapping is declaredl like this:
private
SeriesMappingCollection _chartSeriesMapping;
public
SeriesMappingCollection ChartSeriesMapping
{
get
{
return
_chartSeriesMapping;
}
set
{
if
(_chartSeriesMapping != value)
{
_chartSeriesMapping = value;
this
.OnPropertyChanged(
"ChartSeriesMapping"
);
}
}
}
I'm adding series like this:
SeriesMapping salesAmountMapping =
new
SeriesMapping();
salesAmountMapping.LegendLabel = p.StoreName;
salesAmountMapping.ItemsSource = report.ChartData;
salesAmountMapping.SeriesDefinition =
new
BarSeriesDefinition();
salesAmountMapping.ItemMappings.Add(
new
ItemMapping(
"XValue"
, DataPointMember.XValue));
salesAmountMapping.ItemMappings.Add(
new
ItemMapping(
"YValue"
, DataPointMember.YValue));
report.ChartSeriesMapping.Add(salesAmountMapping);
But the charts is always empty when I'm adding new series... How is this supposed to work? Also, how come legend Label is always set to Series 0, Series 1, etc?
Thanks in advance.