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

Create multiple dataseries

4 Answers 105 Views
Chart
This is a migrated thread and some comments may be shown as answers.
nixon
Top achievements
Rank 1
nixon asked on 15 Mar 2010, 12:24 PM
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

4 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 17 Mar 2010, 11:48 AM
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.
0
Nebojsa
Top achievements
Rank 1
answered on 04 Nov 2010, 11:51 AM
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
0
Giuseppe
Telerik team
answered on 09 Nov 2010, 11:10 AM
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
0
Nebojsa
Top achievements
Rank 1
answered on 10 Nov 2010, 10:32 AM
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!
Tags
Chart
Asked by
nixon
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Nebojsa
Top achievements
Rank 1
Share this question
or