Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3590
How to bind multiple collections to single XamDataChart?
posted

I am converting my Silverlight project to WPF and trying to follow the MVVM pattern. My current Silverlight solution is each time a "channel" is selected by the user, in the code behind, I manually create an x and y axis, series, link them together and then add them all to the XamDataChart that I defined in the XAML. 

I am now trying to use data binding as much as possible but I am not sure if it can be accomplished with data binding alone. Each "channel" needs to have an individual y-axis since the ranges will be different but they can all share the same x-axis (or those can be independent as well, either way will work for my purposes). Also, I had originally used CategoryDateTimeXAxis but now I am updating the chart every second so the interval will always be 1 second and I can therefore use the NumbericXAxis which gives me more control over the label formatting anyway (at least in Silverlight it did). How can I add a single pre defined NumericXAxis in the XAML but them bind all y-axes and series to an ObservableCollection that changes when a user selects or deselects a "channel" or should I even do that?

Suggestions? Do I need to describe what my goals are a little better?