LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically creating multiple graphs

Dear all LV gurus,

I have some problems creating multiple graphs dynamically. The application is to read the values from database but the channels are variables so that the graphs need to be loaded are changing from time to time.

For example, I might need to load 12 graphs(channels) for one station and for another station, I might need to load 19 graphs(channels).

I have an idea but i guess it's like hand coded and not flexible. My idea is too have a VI make it include maximum number of graphs. And when loading, according to the number of graphs, it will make visible only the required number of graphs.

any idea?

BR,
min
0 Kudos
Message 1 of 18
(7,730 Views)
Not sure if you wanted to display multiple channels on one graph or actually display separate graphs.
19 Graphs on the one screen might get hard to read do you have an idea of a kind of layout you want to use?

Have a look at this example which might be something like your after.
It shows an example of letting the user select channels to display on a single graph and displaying multiple graphs using an array.
The array method doesn't update very well though and all graph properties have to be exactly the same.

You could also use re-entrant VIs that pop-up but this might get annoying to an operator too.

_______________________________________
Systems Test Engineer
Certified LabVIEW Architect (CLA)
Message 2 of 18
(7,711 Views)
I have tested with 19 plots on one graph and it's messy as u said. Also I tried with array values showing one graph at a time. It's ok and i could do that.

I am sorry that my previous post  might have made u confused, the main thing is I wanna show like 19 graphs on one VI and let the user print so that the user can print all graphs in one or a few pages(instead of one graph per page).

My idea was pre-loading all maximum number of graphs, then make them(unnecessary ones) invisible when loading like 12 channels. But as you know calling properties of each VI needs lots of wiring and there are literally 20 cases. So I was hoping for someone could show me how to do it programmatically.
0 Kudos
Message 3 of 18
(7,708 Views)
Dear Karissa,

Forgot to say thank you. Your idea of stack plots is nice.

Best regards,
min
0 Kudos
Message 4 of 18
(7,707 Views)

Hi min,

Both of the suggestions in Karissa's example are great ideas. 

Another option is to create an array of references to each of the Waveform Graphs.  The example below allows the user to set the visibility of each graph. 
 
 
For your application, you could use a for loop to programmatically change the visibility of the graphs depending on the number of channels. 


Message Edited by Jennifer_R on 08-05-2008 03:40 PM
Jennifer R.
National Instruments
Applications Engineer
Message 5 of 18
(7,680 Views)
Dear Karissa,

I intend to use your stack multi graph method but the problem is the Y-scales differences. It seems like all graph shares the only one scale so some of the graphs are not even showing at all. Pls advice.

Regards,
min
0 Kudos
Message 6 of 18
(7,657 Views)
You must have changed something because the example has auto-scaling turned on for the Y axis on all graphs and all graphs are separate so there is no 'sharing' of scales unless you program it to be that way. So,
Message 7 of 18
(7,645 Views)
Dear Dennis,

I was using Karissa's example program, not Jeniffer's one.
0 Kudos
Message 8 of 18
(7,628 Views)
Sorry, I missed the reference to Karissa and thought you were talking about the Jennifer's. Since Karissa's is an array, they all have to have the same properties. Jennifer's would work since each graph is separate. The listbox idea in Karissa's could still be used for selecting how many to display.
Message 9 of 18
(7,619 Views)
Dear Dennis,

Thanks for your advice. I really need to use Karrisa's stack plots as I have channels not in fixed numbers, varying from 9 to 24 with different Y-axis scales and i guess it's not possible to do with separate graphs as in Jennifer's example. If you have some ideas, pls advice,

regards,
min
0 Kudos
Message 10 of 18
(7,600 Views)