This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, Does Mindscape chart control support multiple Y-axis? For example, if I have 5 curves on one chart. The 5 curves data have different units. That means I need 5 Y-axis showing in this one chart. Does Mindscape support that? Thank you, Sean |
|
|
Hi Sean, Thanks for contacting us. Yes, our chart control does support this. You can see an example of this in the Sample Explorer demo provided with WPF Elements. When running the demo, go to the Charts category, then click the first item under "Features" - called "Alternate Y Axes". You can then click the "<>" button in the bottom right corner of the app to display the xaml code. As a description of what to do - Add ChartAxis instances to the Chart.AlternateYAxes collection. If you have 5 curves, you'd only need to add 4, as one of the curves can use the standard Y axis. On each axis, make sure to set the Title property, which will need to be unique for each axis. Then, on each series, set the YAxisTitle property to tell it which alternate axis to use. No need to set this property on the series that will use the standard Y axis. By default, each alternate Y axis will be displayed on the right hand side of the chart. You can set the Placement property on each axis to control this though. Let me know if you have further questions about this and I'll help you out. -Jason Fauchelle |
|
|
Hi Jason, Thank you so much for the quick response. I have another question here if you don't mind. Could you please point me to one example that use a collection of curves for binding? What I meant is that for most of the examples that I saw, they use binding like "Data1, Data2". But what if I don't know how many curves ahead and can only have a collection of curves. Is Mindscape able to handle that? I think that this dynamic number of curves problem could also apply to my previous question. Can I define multiple Y-axis on the fly based on my data and the number of curves on the chart? Thanks, Sean |
|
|
Hi Sean, Our Chart control does not have built in support for binding a Chart to a collection of data series, and we don't have a sample of how to do this. It is still possible to get close to what you want though. I would recommend implementing an attached property that you can set on the ChartControl, and that can be bound to a collection from your data model. The logic within this attached property can iterate the collection, and create the appropriate series, and then add each one to the Series collection of the Chart control. This attached property is where you can also set the colors of each series to distinguish the different data sets, and set any other properties you need. The same attached property should also be able to manage the alternate axes. If you need it, here is some information about implementing attached properties: https://msdn.microsoft.com/library/ms749011(v=vs.100).aspx#custom Let me know if you have further questions. -Jason Fauchelle |
|