We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Variable number of series in chart

Hello,

I have a situation where I am drawing a line chart using SyncFusion WPF Chart tools; however, the number of series is variable. I know I can add the series through code-behind, but I was wondering if there is a way to do this more elegantly through XAML data-binding to a collection of lines? My thoughts are:

- Have a class with xPoint and yPoint called DataPoint.
- Have a class containing ObservableCollection, a color, and a legend label called DataLine.
- Have an ObserverableCollection in my program, which can bind to the Chart.

Is it possible to do this through some sort of ItemsSource/ItemTemplate type thing? Or is there another way? I cannot find any examples of this situation in the documentation, but it would be incredibly helpful.

Thank you!





5 Replies

AD Administrator Syncfusion Team March 24, 2009 01:19 PM UTC

Hi Meredith

Thanks for your interest in Syncfusion products.

We don't have the facility to add random number of series through XAML. Instead we can bind the datapoints for each series through XAML.

Please let us know if you require a sample on datapoint binding.

Regards,
Pavithra.J




PJ Pavithra J Syncfusion Team March 24, 2009 01:26 PM UTC

Hi Meredith

Thanks for your interest in Syncfusion products.

We don't have the facility to add random number of series through XAML. Instead we can bind the datapoints for each series through XAML.

Please let us know if you require a sample on datapoint binding.

Regards,
Pavithra.J



SM SM March 11, 2010 04:11 PM UTC

Hi,
Is this now supported?


JS john simmons June 17, 2010 05:54 PM UTC

You could probably do this by creating an observable collection of Series objects, and binding that collection to the chart.Series property.


SS Sujitha S Syncfusion Team June 23, 2010 01:31 PM UTC

Hi John,

Thanks for choosing Syncfusion product.

We donot have this support of binding collection of series through xaml.

Let me know, If you have any queries.

Regards,
Sujitha S

Loader.
Live Chat Icon For mobile
Up arrow icon