I was looking if there is a way to measure the distance between two points in plot window? A use case of that would be :
1. Click one point then drag the mouse and get a continuous read-out of the x/y distance between the clicked point and the current pointer position.
2. Create 2 movable inspect points and display the difference between them (Matlab approach)
I have attached an image that highlights the functionality that I wanted.
Have you tried the MeasureXyAnnotation? This is included in one of our examples here:
- Example: https://www.scichart.com/example/wpf-chart-example-composite-annotations/
- Documentation: https://www.scichart.com/documentation/win/current/The%20CompositeAnnotation%20Type.html
You could use one of these to measure an XY distance on the chart, then read the difference between Annotation.X1, Annotation.X2, Annotation.Y1. Annotation.Y2 to get the difference horizontally and vertically. Annotation.ActualWidth / ActualHeight will give you the distance in pixels too.
There is also an API that least you convert pixel coordinates to data-values and vice versa so if you know the pixel coordinates of those areas you can convert them to data-values.
On my chart, I followed the similar example for MeasureXYAnnotation. I have also used the external dependency on my project. ( I wanted to make sure if the basics are working fine, so for that I took the dependency example). But while running the chart, I am getting an exception. This is what I have been getting:
Message=The type initializer for ‘SciChart.Examples.ExternalDependencies.Controls.Toolbar2D.SciChartInteractionToolbar’ threw an exception.
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
Inner Exception 1:
FileNotFoundException: Could not load file or assembly ‘SciChart.Charting, Version=188.8.131.5276, Culture=neutral, PublicKeyToken=b55dd9efe817e823’ or one of its dependencies. The system cannot find the file specified.
Please login first to submit.