Because right now I am not using any binding and in my core behind I am using the DataSeries.AddRange method to add the data series collection.
Help would be much appreciated!
Thanks,
Farhan
6 Answers, 1 is accepted
Thank you for contacting us.
DataSeriesCollection is not intended to be used by the user for binding data. You need to create your SeriesMapping and ItemMappings and then set the data to ItemSource.
Here you can read for SeriesMapping:
http://www.telerik.com/help/silverlight/radchart-populating-with-data-data-binding-with-manual-series-mapping.html
Here is a link to read about binding nested collections as it seems to me that you are trying to do something similar:
http://www.telerik.com/help/silverlight/radchart-populating-with-data-data-binding-to-nested-collections.html
Evgeni "Zammy" Petrov
the Telerik team

My scenario is such that the user can select columns dynamically and then the chart would display accordingly.Therefore in that case I'll have to declare the itemsmapping in the code-behind? Isn't there any way to execute my scenario declaratively. If I could create create a Series Mapping in my view model and bind it declaratively, is that scenario possible? In your view what would be the best possible solution.
Scenario:
X-Axis will have a period
Y-Axis can have one of the selections:
1) Interest
2) Principal
3) Losses
4) Payments
5) Yields
Thanks,
Farhan

For example,I have such datasource:
Dictionary<string,ObservableCollection<InspClock>> dataSource;
I want to generate dataSource.Count DataSeries througth looping dataSource,How do I?
By SeriesMapping class just only can add multichart by assigning the different column in same datasource!
I would suggest you to create 5 SeriesMappings and hide dynamically the ones you want.
Here is the code how you can edit SeriesMapping visibility:
RC1.DefaultView.ChartArea.DataSeries[0].Definition.Visibility = SeriesVisibility.Collapsed;
Simply hide all and show only the one the user wants to see.
You can also check our hover interactivity:
http://www.telerik.com/help/silverlight/radchart-features-interactivity-effects.html
Let us know if this helped you out.
@Jerry:
You can map data source with SeriesMapping if you have collection in collection. You can do it if you have source like: List<ObservableCollection<InspClock>> dataSource;
I would love to help you out, but I am afraid I cannot understand fully your use-case. Would you please elaborate further on your problem?
Best regards,
Evgeni "Zammy" Petrov
the Telerik team

What would be the best possible scenario.
Thanks,
Farhan
Anyway, in that case I guess your only solution is to add SeriesMappings dynamically.
Just like you would define it in C# you can add them after chart was drawn :
SeriesMapping seriesMapping =
new
SeriesMapping();
seriesMapping.ItemMappings.Add(
new
ItemMapping(
"Salary"
, DataPointMember.YValue));
seriesMapping.ItemMappings.Add(
new
ItemMapping(
"Age"
, DataPointMember.XValue));
seriesMapping.SeriesDefinition =
new
LineSeriesDefinition()
RC1.SeriesMappings.Add(seriesMapping);
The previous code adds a mapping of Persons's Salary and Age property.
This code works in a event handler without a problem.
Let me know if you need any further assistance.
Regards,
Evgeni "Zammy" Petrov
the Telerik team