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

0 votes
0 answers
94 views

Hello,

I’m trying to drag several VerticalLineAnnotationViewModel simultaneously. So if I drag one all other should move the same delta.
I subscribed the “DragDelta”-Event for each VerticalLineAnnotationViewModel. My problem is that “AnnotationDragDeltaEventArgs” seems in pixel unit and I didn’t find a CoordinateCalculator for the NumericAxisViewModel. Is there any solution to convert the dragged delta to dataValue or axis coordinates so I could just add the delta to the X1 property of my VerticalLineAnnotationViewModels?

1 vote
2k views

Hello,
I have a polar chart in my wpf application and I want to get data value from pixel coordinates, once the user has
clicked on scichart surface. This is what I tried:

   mouseClick = (s, arg) =>
        {
            var mousePoint = arg.GetPosition((UIElement)this.sciChartSurface.GridLinesPanel);

    //From cartesian to polar conversion
            double xpolar = Math.Atan(mousePoint2.Y / mousePoint2.X);
            double ypolar = Math.Sqrt(Math.Pow(mousePoint2.X, 2) + Math.Pow(mousePoint2.Y, 2));

            double a = sciChartSurface.RenderableSeries[_trace_index].XAxis.GetCurrentCoordinateCalculator().GetDataValue(xpolar);
            double b = sciChartSurface.RenderableSeries[_trace_index].YAxis.GetCurrentCoordinateCalculator().GetDataValue(ypolar);
};

This code gets mouse point coordinates, then it converts pixel coordinates to polar, and then (a,b) data are obtained with
GetCurrentCoordinateCalculator().GetDataValue(), but a and b have some strange values. I’ve tried just the opposite (from data value to pixel coordinate using GetCoordinate()), but it still doesn’t work. Any ideas? Is it possible to get data from pixel coordinates in polar chart?

Thanks in advance,
Juan

Showing 2 results
This template supports the sidebar's widgets. Add one or use Full Width layout.