From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Property Nodes/Features for Charts

Solved!
Go to solution

Hi everyone,

 

In my program, I have a chart which can have up to 40 plots on it.  I have a feeling this isn't a feature, but a colleague of mine asked if it is, so I thought I would ask anyway.  Is it possible to hover the mouse over one of the plots on the chart and have it tell you what plot it is?  I have a legend for the chart, but with up to 40 plots, it can be difficult to read.

 

Thanks!

0 Kudos
Message 1 of 12
(4,414 Views)

We don't get that function, but this might help.

 

Right Click on your Plot Legend and select Visible Items, then turn on the Plot Visibility Checkbox.

 

This will allow you to turn plots on and off to clean things up a bit.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 12
(4,382 Views)

You can use cursors to do this.  There is an XYGraph.Cursor.Plot property node.  Note however that I have never had good luck with cursors... they often exhibit unexpected behavior.

 

Basically you will trigger on the XY Graph "Mouse Down?" event.  Look at the coords, call the "Map Coords to XY" invoke node. then set the XYGraph.Cursor.PosX to the X click.  It should snap to the nearest plot and then the XYGraph.Cursor.Plot will tell you which one the click was closest to.  (You could of course do this with the Mouse Move event to get a constant udpate and have hidden cursrors).

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

Here is some sample code

 

0 Kudos
Message 4 of 12
(4,368 Views)

Cursors don't work on charts, AFAIK.  The OPs post was for charts. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 12
(4,366 Views)

@aputman wrote:

Cursors don't work on charts, AFAIK.  The OPs post was for charts. 


Oops!  I missed that he wanted it on a chart.  Thanks:)

 

I have done an XYGraph with a circular buffer before so it behaved like a waveform chart but that gets cumbersome.

0 Kudos
Message 6 of 12
(4,363 Views)
Solution
Accepted by topic author _natalie_

Chart_1.png

 

 Is it possible to hover the mouse over one of the plots on the chart and have it tell you what plot it is?

 

Yes

 

The above may be a start.

 

It is messy but ssems to work.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 12
(4,276 Views)

Hmmm...

 

Nobody wanted to call me out on using the X value as the sample array index huh?

 

(smiley-wink)

 

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
(4,252 Views)

@Ben wrote:

Hmmm...

 

Nobody wanted to call me out on using the X value as the sample array index huh?

 

(smiley-wink)

 

Ben


I wanted to... until I ran your snippet to see what you were doing 🙂  Clever solution.

Message 9 of 12
(4,245 Views)

Well, I thought about a similar solution but what happens if you have two plots in the same location?  I couldn't think of a way to handle that so I didn't even try.  Smiley Frustrated

 

Maybe your solution does handle it???  Nice job.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 10 of 12
(4,230 Views)