14
Vote

Databinding for Multiple Series

description

The ability to databind multiple datasets (collection of a collection) to a chart is needed. Right now, you can easily databind one set of points with no problems at all, however if you were to want to plot multiple series of lines, you would need to do this in the code behind. Being that MVVM is so popular, it would be very cool to be able to bind to the Series property in the Chart control, and use the IValueConverter to pass back the correct series set.
 
Example:
 
<Charting:Chart Series="{Binding Path=COFC, Converter={StaticResource lineSeriesConverter}, Mode=TwoWay}"/>
 
Right now, you will get an error:
 
AG_E_PARSER_BAD_PROPERTY_VALUE,
 
But while doing testing, I have also received this error:
 
Invalid attribute value {Binding Path=COFC, Converter=LineSeriesConverter} for property Series. [Line: 8 Position: 32]
 
Our online thread about this:
 
http://silverlight.net/forums/t/58624.aspx
 
Attached is a very simple app to reproduce the problem we are having.
 
I have researched many different methods of resolving this, but have found no viable solution.

file attachments

comments

jmorrill wrote Dec 24, 2008 at 3:05 AM

Using attached properties, I was able to make binding multiple series work. Here is the post:

http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/351/Silverlight-Charts-Binding-multiple-Series.aspx

vorrtex wrote Apr 3, 2011 at 10:42 PM

I have created the extended chart which works with almost all types of series, even with stacked.
http://vortexwolf.wordpress.com/2011/04/04/silverlight-chart-multiple-series-databinding/

JobaDiniz wrote Jun 4, 2012 at 12:24 PM

It's a 4 year issue, and it's not solved yet... that's a bummer