This is a migrated thread and some comments may be shown as answers.

Multiple automatic series mappings from nested collections?

1 Answer 60 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 16 Nov 2011, 02:33 AM
Hi, we want to create a RadChart with multiple line series. The data source would be a list of lists using ObservableCollection so the data source property would look like this:

public ObservableCollection<ObservableCollection<DataObject>> { ... }

Ideally we want each line series to be created automatically from the data source, and the data points to be mapped from the collection for the current series. From this we would then expect to be able to add / remove collections to the data source and have the corresponding series automatically updated on the chart via bindings.

I know you can do this using the CollectionIndex property, but this requires each line series to be mapped manually in XAML or code-behind. 

I've defined a DefaultSeriesDefinition for a line series, but this doesn't provide any capability to indicate what the item mappings for each default series would be, or where the series should get its data points from.

Is there a method for generating the series automatically that would be compatible with this data source? Or do I have to generate each series manually in code?

Thanks,

Sam

1 Answer, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 18 Nov 2011, 01:03 PM
Hi Sam,

Automatic series mapping works when you have scenario like this:
List<MyOBj> where your object has three numeric properties. Using this approach you will get three series for each numeric property.

In order to use nested collections you should use series mappings and map each series manually.

More about data binding with automatic series and nested collections can be found in our help topics here:
http://www.telerik.com/help/silverlight/radchart-populating-with-data-data-binding-with-automatic-series-binding.html
http://www.telerik.com/help/silverlight/radchart-populating-with-data-data-binding-to-nested-collections.html

Greetings,
Peshito
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Chart
Asked by
Sam
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or