LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two legends for one plot of data graph

Hello,

   I am trying to achieve something but I havent been able to.

I am wondering if it is possible in labview also.

I have two list boxes. One to select data files in a directory and the other one to select channels of data in that file selected. Both listboxes are set for multiselection mode.

So when I select a data files and I select a channel, I would like the legend for the channel to display on the side of the graph where the normal legend location is. but also I would like to show the legend of the channel as well at the bottom of the graph or anywhere off teh graph.

In other words, i want both legends for both item selected in the list boxes.So far I can only do it for either or not both. That was possible using the waveform graph property node, plotname(data files name string) , activeplot, legNumRows. I tried to do the same for the channels but it overwrites the previous legend each  time.

Can I get some help. Lead me in the right direction

0 Kudos
Message 1 of 13
(3,746 Views)

How about a picture box that displays the front panel image of the real legend?

0 Kudos
Message 2 of 13
(3,716 Views)

@ritch_by_nature wrote:

location is. but also I would like to show the legend of the channel as well at the bottom of the graph or anywhere off teh graph.

 


Why not set the Caption to the "legend of the channel"?  Make the Caption visible and (you'll forgive the phrase) "Bob's Your Uncle".

 

Bob Schor

0 Kudos
Message 3 of 13
(3,705 Views)

Maybe Ritch could post a picture showing what he is looking for.

0 Kudos
Message 4 of 13
(3,700 Views)

here's the frotn VI, and the code that handles that

Download All
0 Kudos
Message 5 of 13
(3,652 Views)

What if I select more than one channel, what would happen?

0 Kudos
Message 6 of 13
(3,634 Views)

Ritch,

 

     Can you attach the VI's, not pictures of the VI's?  I was hoping to open the VI, turn on the Plot Legend (so you could see the Channel names) and turn on the Caption (and set it programmatically to something like the Plot Name), demonstrating that we seem to have already answered your original question (although you do not seem to have responded to our suggestions).

 

      However, I cannot open your attached PNG as LabVIEW code (though it seems to be a Snippet ...).  What is wrong with the previous suggestions?  Why don't you attach real code so we can demonstrate, with your code (preferably with data "attached" to the inputs so if we run it, Plots will appear), what we are talking about (so you can say "Yes, that's what I want" or "No, I want this other thing, instead)?

 

Bob (frustrated) Schor

0 Kudos
Message 7 of 13
(3,622 Views)
Well Bob, what I'm talking about is that I would want another legend on top of the normal built in one. The built in one is for data files I select. The second one I want is for the channels. Two legends each displaying one or multiple selections from the list boxes.
Yes the snippet has subvis in it. Not sure how that would work if you drag it to your block diagram. Bare with me I'll post the vis shortly
0 Kudos
Message 8 of 13
(3,606 Views)

I still don't quite understand what you are looking for.

 

A legend is a list of plots that make up a graph.  It is a one to one relationship.   As it is now, your graph shows 2 plots, but only shows 1 plot listed on the legend.  (Probably needs to be expanded.).

 

It sounds like you want some sort of "tree" arrangement where you have a one to one relationship with "channels" to plots on the graph, but somehow want that grouped together in some way based on a file.

 

A plot legend isn't going to give you that capability.

0 Kudos
Message 9 of 13
(3,597 Views)

here are the vis. That legend shows 2 plots because I select one data files and two column from that data files.. the plot is dependant on both channels and data files. if I were to select one more data files, I would have 4 plots on the graph but two legends. So the legend you're seeing is because I select the data files. That is the name of the data file. But I want to show Also the name of the channels selected. Therefore I was wondering If I can ceate a second legend for that graph. I would have one legend showing data files name selected and anouther showing channels selected

0 Kudos
Message 10 of 13
(3,584 Views)