06-16-2011 07:06 AM
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
Solved! Go to Solution.
06-19-2011 03:06 PM
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.
06-19-2011 03:52 PM
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.
06-29-2011 09:09 AM
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
06-29-2011 10:29 AM
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.
I've attached an example of this - let me know if you have any questions.
NickB
National Instruments
06-30-2011 05:03 PM
The attached project helped me a lot.
Thank you very much Nick!