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

0
0

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

Version
6.2.1.13304
Images
  • You must to post comments
0
0

Hi Sarbesh

Have you tried the MeasureXyAnnotation? This is included in one of our examples here:

enter image description here

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

  • You must to post comments
0
0

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.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.