Hi,
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.
Thanks
- Sarbesh Banskota asked 3 years ago
- You must login to post comments
Hi Andrew,
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:
System.Windows.Markup.XamlParseException
HResult=0x80131501
Message=The type initializer for ‘SciChart.Examples.ExternalDependencies.Controls.Toolbar2D.SciChartInteractionToolbar’ threw an exception.
Source=PresentationFramework
StackTrace:
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=6.3.0.13476, Culture=neutral, PublicKeyToken=b55dd9efe817e823’ or one of its dependencies. The system cannot find the file specified.
- Sarbesh Banskota answered 3 years ago
- You must login to post comments
Hi Sarbesh
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.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 3 years ago
- You must login to post comments
Please login first to submit.