LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

legend and cursors of an XY Graph

Hello!

 

I have an application where I generate many different plots on one graph ( from 1 to 30 plots).

I want to see which plot goes with which data in a legend on the right of the graph. and also when I put the mouse cursor
over the plot, it's indicated the name of the plot which is the same appeared in the legend. Is there a way to have each plot name shown up when I mouse over a plot? like in excel plots.
Another point please: How can I set up the cursor in the middle of the graph before starting to run the app so that the user can see it clearly and move it over the plots? because it appears in the corner , not really visible.

Please any help in my issue 

Thank you so luch in advance. 

0 Kudos
Message 1 of 12
(3,648 Views)

My coffee has not engaged so I suspect there may be an easier way but here goes for part one of your question.

 

XY Graph >>>  Event Case >>> Mouse Move >>> Coords >>> Invoke Node Get PlotAtPos >>> PlotNum >>> Property Node Active Plot >>>Plot.Name >>> Bundle name and position >> Property node AnnotationList.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 12
(3,639 Views)

Drat -- I clicked Cancel by mistake, and did it twice, so now I have to remember and retype...

 

We often ask that Posters include code.  If you had attached a VI showing your Front Panel with Graph (or Chart), we could have shown you how you can "drag up" the Plot Legend to "see" multiple Plot Identifiers, how you could move the Legend to the right of the plot (instead of the top), how you could add a "Visibility" option to hide plots you don't need to see, how to change the color, line thickness, whether Lines or Points, and point styles of your plots, and best of all, how anything (I think) that you can do manually you can also do programmatically with Property Nodes.  I presume you know that it is sometimes useful to add an offset to data being plotted so all the lines don't lie on top of each other (it's your call -- if "shape" and "synchrony" matter more than "matching value", the offset trick can be very helpful).

 

You can also programmatically manipulate cursors.  As I recall (I don't use them much), there is an "experience" curve in dealing with cursors, but positioning them in the center of the plot should be easy (you just need to be able to compute the coordinates of the middle of the plot).  There should be LabVIEW Examples ...

 

Bob Schor

0 Kudos
Message 3 of 12
(3,627 Views)

Hi!

 

I thank you for your suggestion but there is something is objects type that doesn't work,

Please see attached my trial VI below, What's wrong ?

Thank you in advance 

0 Kudos
Message 4 of 12
(3,620 Views)

Hi! 

 

I thank you for your response.

You will find attached the main VI , I can not attach the hole project due to confidentiality issues, but may be you can check my method using event structures in order to set up legend and cursors. When running the VI, I can not get the right legend and cursor name corresponding to displayed plot. the name of the plot depend on the user configuration that he select, that's why I used many condition structures, and put the plot name( the global variables), what shoud be displayed in the legend, as inputs of these condition structures, and used property nodes ( nom tracé and tracé actif ) but my method does not work.  

Please i'm very grateful for any help

Thank you so much. 

 

0 Kudos
Message 5 of 12
(3,613 Views)

@Ben wrote:

My coffee has not engaged so I suspect there may be an easier way but here goes for part one of your question.

 

XY Graph >>>  Event Case >>> Mouse Move >>> Coords >>> Invoke Node Get PlotAtPos >>> PlotNum >>> Property Node Active Plot >>>Plot.Name >>> Bundle name and position >> Property node AnnotationList.

 

Ben 


I should explain what that previous post was all about.

 

That post hints at the methods and properties that can be used to display a plot name near where the mouse is when moved over a XY graph. It detects the position of the mouse in the XY graph, figures out which plot it is close to, gets the name of that plot, creates an Annotation with that plot name and puts the annotation where the mouse is.

 

Add in a Mouse leave event to hide the annotation to hide the annotation and you should get an effect like you see in Excel.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 12
(3,596 Views)

Hi! 

I thank you for you reply! 

I tried using methods and property nodes that you suggested to me, to display the plot name near to the correspondant plot but I didn't succeed.  The issue that I encoutred is how to get the link between the plot displayed, its name in the legend and the name displayed near to the plot when moving the cursor!!

Please do you have an example or a snippet that I can refer to it to do that 

Thank you in advance for your help

 

0 Kudos
Message 7 of 12
(3,569 Views)

Show us your code (in LV 2016 or earlier) and include some sample data so we can see where you are going wrong.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 12
(3,549 Views)

Hi ! 

You will find attached the main VI version 14.0, 

Actually, In the event structure " noise analysis graph" , cursor move, I used graph property node ( tracé actif et nom de tracé) in each condition structure. In fact, depending in the boolean control pressed, that each time we will have certain plots and for each plot I have to display the name ( exp: order 1, order 2...which are in global variable) + X axis + Y axis ..

0 Kudos
Message 9 of 12
(3,546 Views)

Sorry but I do not see a mouse move event in your code OR the invoke node to convert mouse position to a plot number.

 

What I had outlined was a method to "show the plot name as the mouse moved over the XY graph".

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 12
(3,540 Views)