ViewXY Selected Rectangle

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
juergen
Posts: 27
Joined: Tue Feb 04, 2014 8:11 am

ViewXY Selected Rectangle

Post by juergen » Sat Mar 15, 2014 8:09 pm

Hi,
Is it possible to select an area like the zoom selection and get the informations about position and size or do I have to do it by hand?

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: ViewXY Selected Rectangle

Post by ArctionPasi » Sun Mar 16, 2014 10:39 am

I'd probably use AnnotationXY for it. It can be set to use screen coordinates or axis values.

For screen coordinates based approach, set:
annot.Style = Rectangle
annot.Anchor.X = 0; //sets anchor to top left
annot.Anchor.Y = 0;
annot.LocationCoordinateSystem = ScreenCoordinates;
annot.LocationScreenCoords.X = mouseX;
annot.LocationScreenCoords.Y = mouseY;
annot.Sizing = ScreenCoordinates
annot.SizeScreenCoords.Width = 100;
annot.SizeScreenCoords.Height = 100;

when you then grab from the edge of the annotation or drag it to other location, SizeScreenCoords and LocationScreenCoords get updated, and you can use that info for further data analysis. You can always convert the screen coordinates into axis values (data values) by using axis.CoordToValue method.

For axis values based approach, take a look at properties
annot.Sizing = AxisValueBoundaries
annot.AxisValuesBoundaries.XMin, XMax, YMin, YMax

:freak:
LightningChart Support Team, PT

juergen
Posts: 27
Joined: Tue Feb 04, 2014 8:11 am

Re: ViewXY Selected Rectangle

Post by juergen » Mon Mar 17, 2014 3:35 pm

It works.

Thank's a lot ...

Post Reply