LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Label each point in scatter plot

Solved!
Go to solution

Hi There,

 

I am plotting a set of data (in x,y format) on a scatter plot. Is there a way in labview such that when i move mouse over some dot it can tell me information about that dot (like the name of that set).

 

Thanks in advance

Yogesh 

PS: i am using Labview 8.2 

0 Kudos
Message 1 of 5
(4,117 Views)

The easy solution is to just use a cursor. Then you just move the cursor and the information is displayed in the cursor palette.

 

The harder solution is to monitor the MouseMove event with an event structure.  In that event case you can wire the coordinates to the Map Coords to XY method to determine if you're over a point. Not sure how you want to display the info. With some sort of "tip-like" little window? Or just on an indicator on the front panel?

0 Kudos
Message 2 of 5
(4,109 Views)

The problem with that is, it will display the x and y value only. But what i want is, i have another file with all the names for the each point. I am trying to find a way to link each name to each point and when i move cursor over some point i should be able to see what is the name of that point. I do not care if it is mouseover event or by just using cursor and string indicator. 

Names of "name file" is arranged in same order as my points in spreadsheet.

Thanks

Yogesh 

0 Kudos
Message 3 of 5
(4,092 Views)

I made this program. It uses two text file as input. One file has name of each data set (32) in column while other file has values of each set for five different axis (in five rows and 32 column)). You can see in the program i am using a property node to change value of axes to see scatter plot of two axis i want. I also added a cursor and using another property node to get index value of that cursor. I am using that index value to get the right file-name in the string indictor. The problem i am facing is how to get file name everytime i move my cursor to next point. I used case structure with cursor move but using that hangs the program and i can not change anything.

I am using labview 8.2.

Thanks for help

Yogesh 

0 Kudos
Message 4 of 5
(4,087 Views)
Solution
Accepted by topic author Yogesh9ic

The reason why it hangs is because you have 2 event structures inside a loop. You should only have one event structure in a loop. This is documented in the LabVIEW Help. With 2 event structures one of them will block the other.

 

Your code is also about 3 times larger than it needs to be:

 

  • To create the array of names for the dropdowns you only need to autoindex a for-loop from the 2D array of data and use the Format Into String function.  You don't actually need to use the values - you only need to autoindex the for-loop.
  • Using Delete From Array and Reshape Array just to pull out a row is simply silly (not to mention a Rube Goldberg). That's what Index Array is for.
  • In the Cursor Move event case you only need one function: Index Array. The point index is already available to you from the event case's data.
  • Half of the code really belongs outside of the while loop since none of that data ever changes, so what's the point of regenerating it each time?
  • Instead of using 2 Index Array functions just to get the list of names, wire a True to the Read From Spreadsheet File's transpose? input and use the first row output.

I've attached a simplified version of your VI.
Message 5 of 5
(4,076 Views)