SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

0
0

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)?

  • You must to post comments
1
0

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

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.