I have been looking for a good way to obtain data from a multi-line chart (more than 1 y-value/y-axis) by either clicking an area that’s highlighted with a vertical line rollover, or selected with a vertical slice.
Basically I would like to take the data that I see in the Series Vertical Slices example, and extract the X-Axis values, as well as the Curve A, Curve B, and Curve C values that are shown on the vertical slice, so that I can insert that in something like a TextBox in a WPF.
Any idea how to do this, as well as with MVVM? (Will use MVC if necessary).
It’s easy to do with a single RolloverModifier, you can just bind to the RolloverModifier.RolloverData property. Take a look at this page which describes what you get in RolloverModifier.RolloverData and how to bind to it.
For the VerticalSliceModifier it’s a little more difficult.
Well, X-value is actually on the VerticalLineAnnotation.X1, so you can bind to this TwoWay if you want to get this value in your viewmodel. The Y-values are not so simple. These are discovered as a result of hit-testing the RenderableSeries at X to find Y.
You know what I would honestly suggest you do, I would suggest looking into creating a custom chartmodifier. We have a tutorial here on creating a custom rollovermodifier, it gives you an insight into what is occurring inside this modifier. You could then extend it to meet your needs.
How does that sound?
Please login first to submit.