Is there a way to find out what the Y value is where the VerticalLineAnnotation intersects the line chart that it is crossing over?
Edit: The attached image shows these intersections. I would like to know how I can get a hold of those y values.
- Ryan Woods asked 8 years ago
- last edited 8 years ago
- You must login to post comments
Very good question
VerticalSliceModifier.SeriesData.SeriesInfo exposes a collection of SeriesInfo – viewmodels for tooltips. However, it is difficult to determine which are for which slice.
You might have to do some custom coding to achieve this. Can you share why you want to do it? (What’s the requirement)
Best regards,
Andrew
- Andrew Burnett-Thompson answered 8 years ago
-
I would like to do this to bind the Y1 and Y2 values of a LineAnnotation to the Y intercepts of two VerticalLineAnnotations. I have almost got it working, but if there is more than one series of data, then it uses the incorrect value. Right now, I have: Y1=”{Binding ElementName=sliceModifier, Path=SeriesData.SeriesInfo[1].YValue, FallbackValue=0}” and this works great if only one series is visible. The moment I make a second series visible on this chart, it fails to find the correct Y Value.
-
SeriesInfo does have the RenderableSeries, so I guess using a converter, you could bind to SeriesData, and pass in a SeriesName as string. Then search in c# code in your converter for SeriesData.SeriesInfo.FirstOrDefault(s => s.RenderableSeries.DataSeries.SeriesName == seriesName).
-
That is exactly what I wound up doing except I used a skip(Number).FirstOrDefault to find the appropriate series.
-
@Ryan – When I add below line, my vertical line annotation height becomes very small and it aligns to top of chart. Y1=”{Binding ElementName=sliceModifier, Path=SeriesData.SeriesInfo[1].YValue >>> sliceModifer is my VerticalSliceModifier control under ModifierGroup.
- You must login to post comments
Please login first to submit.