SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
I am using a setting pretty similar to the one in the RealTimeCursor.xaml part of the demo project, with the difference that I implement MVVM and the data series come from my view model.
So basically I have a chart with multiple FastLineRenderableSeries, which use XyDataSeries as data series. These series are updated dynamically, to reflect changes in the model properties they represent. My problem is the user should be able to change the unit of the property which is charted by any of those series during runtime. For instance we start with speed in m/s and he changes it to km/h. Then the chart should also show the speed series in km/h. I looked for a way to attach a converter either to the values of the XyDataSeries, or to the YAxis, some built in method which would help me change the visual representation of the series to reflect the unit change.But I didn’t find anything of this sort.
Is there a smart way to do this?Or every time the unit is changed I need to create a new series with the values being converted to the proper unit?
I think what you’re looking for is the LabelProvider feature.
It acts like a ValueConverter for YAxis or XAxis Labels, but has some additional functionality, such as the ability to create custom data-contexts for labels, and format both cursor and axis labels.
Take a look at the above, it should answer your question.
Please login first to submit.