From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

adding and deleting plot on xy graph

Solved!
Go to solution

Hi,

 

I am creating a VI whereby one can add xy plots from csv files to a xy graph. the xy plots are held in a cluster array. so far so good.

 

Now I would like to created a drop down list of the plot names of the plots added to the xy graph. Is there any way to do that? My aim here is to be able to select a plot from the dropdown and then delete it. is that possible?

0 Kudos
Message 1 of 8
(4,083 Views)

You could consider using a Listbox and either setting the Visible property of a specific plot, or just using Delete From Array to remove the specific cluster from your array collection (make sure to also remove it from the Listbox in that case).

 

If you want to show and hide the Listbox, you can have a boolean button who's value change triggers a change on the Listbox's Visible property.

 

If you're familiar or comfortable looking at Actor Framework projects, I can send you a project I have for displaying graph data. It's quite a bit more in-depth than what you're looking for, because it has handling for a "Measurement Result" type that I've used to group different outputs from different measurements, but the actual graph being used is still an XY-Graph and the overlay is a Multicolumn Listbox.

 

You might also like these VIs for transparency: Transparency VIs. I use some modified version of these for my overlay.


GCentral
0 Kudos
Message 2 of 8
(4,078 Views)

Hi sherzaad,

 

Now I would like to created a drop down list of the plot names of the plots added to the xy graph. Is there any way to do that?

Yes: create a dropdown list to let the user select the plots…

 

My aim here is to be able to select a plot from the dropdown and then delete it. is that possible?

Yes sure! You need to program the logic behind those operations in LabVIEW…

 

I prefer listboxes: much easier to handle, for both the programmer and the user:

check.png

In the listbox on the upper left the user can select signals to view them in the graph…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(4,075 Views)

Ok. I get that. but how do I get plot names into the list box? listbox is I32...

0 Kudos
Message 4 of 8
(4,065 Views)

Hi sherzaad,

 

you set the listbox item names by using a property node of the listbox named "item names"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(4,061 Views)

ok thank you... one more thing what property name should I use to list them in the list box? I tried using "plot name" but I do not think it's the right one to use to get all the plot names...

0 Kudos
Message 6 of 8
(4,049 Views)
Solution
Accepted by topic author sherzaad

you have to iterate through all plots to get each plot name.

if the number of plots is static or known, you can use a for-loop,

otherwise, just iterate until the property node errors.

plot-names.png

hope that helps


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 7 of 8
(4,042 Views)

Thanks! that works for me!

0 Kudos
Message 8 of 8
(4,038 Views)