Crosshair cursor for IntensityGridSeries

Need help in implementing some specific function to your LightningChart Ultimate powered application? Post a question and get code snippets from other LightningChart Ultimate community members.

Moderator: Queue Moderators

Post Reply
ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

Crosshair cursor for IntensityGridSeries

Post by ahe » Thu Apr 21, 2016 3:03 pm

Similar to the "Spectrogram cross-section" demo, I implemented a wrapper for my application. But in addition, I'd like to be able to move both lines simultaneously if the mouse pointer started dragging near the intersection of the lines:
Crosshair1.png
Crosshair1.png (67.89 KiB) Viewed 9337 times
At the moment, I am doing this with a transparent AnnotationXY (Style = AnnotationStyle.Rectangle). Unfortunately, the annotation is always right and below the Location (with LocationCoordinateSystem = CoordinateSystem.AxisValues). If I switch to CoordinateSystem.RelativeCoordinatesToTarget, I can center the rectangle with LocationRelativeOffset, but then I run into problems with the moved event.

While LocationAxisValuesChangedByMouse delivers the correct value, LocationRelativeOffsetChangedByMouse seems to deliver ScreenCoordinates.

At this point, I cannot figure out a solution to fix this. Do you have any advice?

Thanks, Andreas

LCU 7.0.2
Another user with the same problem: http://www.arction.com/forum/viewtopic. ... shair#p773
Attachments
AL_CursorCrosshair.zip
Sample Code
(7.73 KiB) Downloaded 650 times

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

Re: Crosshair cursor for IntensityGridSeries

Post by ArctionPasi » Thu Apr 21, 2016 3:11 pm

Hi,

how about adding another LineSeriesCursor and ConstantLine with LineStyle.Width = 20 etc, transparent? In the position changed event handler, update the visible cursors position?
LightningChart Support Team, PT

ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

Re: Crosshair cursor for IntensityGridSeries

Post by ahe » Thu Apr 21, 2016 3:35 pm

I'm sorry, I do not understand what you're proposing.

The problem is, that I cannot move the crosshair in both directions at the same time. ConstantLine and LineSeriesCursor do not include the coordinate for the other axis in their respective MovedByMouse events. Thus the workaround with the transparent annotation which can be moved freely. I just cannot get it to align properly on the crosshair, i.e. centered.

Please try my sample code to see the problem. I tried to recreate the image, the first one probably was too confusing.
Crosshair2.png
Crosshair2.png (21.84 KiB) Viewed 9333 times

Post Reply