Multiple automatic series mappings from nested collections?

2 posts, 0 answers
  1. Sam
    Sam avatar
    67 posts
    Member since:
    Jun 2011

    Posted 15 Nov 2011 Link to this post

    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?


  2. Peshito
    Peshito avatar
    585 posts

    Posted 18 Nov 2011 Link to this post

    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:

    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top