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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

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.