I have two draggable vertical “cursors” using the vertical line annotation as part of the vertical slice modifier. Works great except that as I zoom it becomes apparent the user is dragging the cursor between data points and the labels are showing the values of the line that extends between the points. Is there a away to “snap” the line to the data points like the rollover modifier does? Or alternately, is there a way to have multiple rollover modifiers (I need two cursors)?
- David Adams asked 9 years ago
- You must login to post comments
Hi David,
We don’t provide such capability out of the box, but it is possible to implement with a bit of customization (using our hit-test API):
public class VerticalLineEx : VerticalLineAnnotation
{
protected override void MoveAnnotationTo(AnnotationCoordinates coordinates, double horizOffset, double vertOffset)
{
var series = ParentSurface.RenderableSeries[0];
var hitTestResult = series.VerticalSliceHitTest(new Point(coordinates.X1Coord + horizOffset, 0));
horizOffset = hitTestResult.HitTestPoint.X - coordinates.X1Coord;
base.MoveAnnotationTo(coordinates, horizOffset, vertOffset);
}
}
Please try the code above and let us know if it works as expected,
Best regards,
Yuriy
- Guest answered 9 years ago
-
Hi Yuriy, I also want the vertical slice modifier to snap to the datapoints and tried to implement your code example. Unfortunately I get an error that says, that there is no VerticalSliceHitTest in IRenderableSeries. Is your code example still up-to-date? Or am I missing another point? Thank you for your help. Best regards
- You must login to post comments
Please login first to submit.