Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

what point in the plot the mouse hovers in scatterGraph Measurement Studio 2010 + .Net C#

Solved!
Go to solution

Hi,

 

I'm using Measurement Studio 2010 for .Net, Win7 64bit, VS2008, scatter graph.

I would like to know the exact point of the plot the mouse hovers above and display a tooltip the gives information regarding this point. is there away to get information of the current point the mouse hovers above?
 

thanks in advance for you help,

Oren

0 Kudos
Message 1 of 6
(5,457 Views)

Hi oren_fourier, I found a couple of online articles that might help you out here. They are listed below.

 

http://digital.ni.com/public.nsf/allkb/98024D511124B8CF86256D210079FF01?OpenDocument

 

http://zone.ni.com/devzone/cda/tut/p/id/10525

 

I hope this helps.

 

Regards,

 

Josh L.

 

Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(5,448 Views)

Hi oren_fourier,

 

Just an update to my previous post. I think you want to take a look at the cursor class. The best way to get more information on this class is by going into the "view help" section under the help option. There are several functions that allows graphical user interface. I found a function called XYCursorLabelDisplay. I think it displays the x and y coordinates.

 

I hope this helps.

 

Josh L.

Applications Engineer
National Instruments
0 Kudos
Message 3 of 6
(5,445 Views)

Hi Josh,

 

Thanks for the replies.

I'm not sure I was understood correctly.

my question is if the Mouse hovers (and this is the important word here - hover) over a point in a plot can I know which point it is? is there an event that fires that can tell me "the mouse hovers now over point index y on plot z"?

I have found that the PlotAreaMouseHover can tell me the x,y coordinates of the mouse when it hovers over the plot area. but how can I deduce from that if a plot exists in these x,y coordinate, which plot it is and what is the index of the plot's data that is displayed in these coordinates.

 

Thanks in advance,

Oren

0 Kudos
Message 4 of 6
(5,361 Views)
Solution
Accepted by topic author oren_fourier

Hello Oren -

 

To accomplish this, you can use a combination of HitTest, GetPlotAt, and InverseMapDataPoint.  Essentially, you check if you're mouse is over a plot (HitTest), then you get the plot it's over (GetPlotAt), then you transform the mouse coordinates to data coordinates (InverseMapDataPoint).  Then you have to search the input array for a point that matches the cursor position.

 

NickB_06-29_10-23-21.png

 

I've attached an example of this - let me know if you have any questions.

 

NickB

National Instruments

0 Kudos
Message 5 of 6
(5,357 Views)

The attached project helped me a lot.

 

Thank you very much Nick!

 

0 Kudos
Message 6 of 6
(5,346 Views)