Create multiple dataseries

5 posts, 0 answers
  1. nixon
    nixon avatar
    7 posts
    Member since:
    Dec 2006

    Posted 15 Mar 2010 Link to this post

    Hi there,
    I have a question that i cant find any answears on and wonders if anyone out there could help me out.

    I have the need to create a Chart with a unknown number of DataSeries at compile time, i only know the number of series to show during runtime. I wonder if it is possilbe to bind the itemsource of a chart to an observablecollection that contains my dataseries.
    I do understand that this can be achived by doing this in the code behind / managed code, but i rather would like to only use XAML and binding to an observable collection, the MVVM approach.

    Can this be achieved wtih telerik?
    Best Regards
    Niclas
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 17 Mar 2010 Link to this post

    Hi nixon,

    You can bind the control to any IEnumerable ItemsSource and that includes nested collections (collection of collections) in XAML but generally you would also need to set up the necessary series mappings as well and this cannot be done statically in XAML if you do not know the number of series you will be displaying in the chart control.

    Alternatively, you can use the databinding with automatic series mappings feature provided by RadChart as well but you will need a specially-crafted business object that contains all necessary numeric fields that should be displayed as chart series.


    Sincerely yours,
    Freddie
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Nebojsa
    Nebojsa avatar
    4 posts
    Member since:
    Nov 2010

    Posted 04 Nov 2010 Link to this post

    Hi!

    I'm new to telerik controls, and I now have the same situation as Nixon described. Can you please tell me how to achieve this using code-behind? My ItemsSource is Dictionary<String, Dictionary<DateTime, double>> where string key is the label of the series, and Dictionary<DateTime, double> value is the data for the series.

    Best regards,
    Nebojsa
  5. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 09 Nov 2010 Link to this post

    Hello Nebojsa,

    We believe the linked help articles contain the necessary information for code-behind scenarios as well. Could you elaborate what is the specific problem you are experiencing so we can advise you properly how to proceed.


    All the best,
    Freddie
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Nebojsa
    Nebojsa avatar
    4 posts
    Member since:
    Nov 2010

    Posted 10 Nov 2010 Link to this post

    Hi!

    I didn't see the 'nested collections' link when I was reading this topic for the first time. Everything I needed is described there.

    Thanks!
Back to Top
DevCraft banner