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.

Example Code

How to create an array of XY graphs for your LabVIEW front panel.

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
To  show how we can create an array of graphs on your LabVIEW front panel.

Description:
This simple VI would generate a random number for building an array of numbers. Using the for loop structure, we could basically build an XY graph of it. Within the example, we could make those for 1D array and 2D array

Instructions:
To implement this example:

  1. Run the VI
  2. (Optional) Configure the algorithm by accessing the block diagram

To execute this example:

  1. Install the required software.
  2. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible

Hardware
-

fp.PNGbd.png

**This document has been updated to meet the current required format for the NI Code Exchange.**

Stephen C
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
G-Money
NI Employee (retired)
on

Interesting work around to the fact that you can't natively have an array of grahps/charts in LabVIEW currently (2011).

Phatin
Member
Member
on

I have done this to display an array of XY graphs, but I've noticed that all the graphs are linked as far as the display properties.  For instance, all of the graphs are forced to the same scales.  This creates a problem when some of the elements have higher amplitudes than others.  If I try to adjust the scale for one graph in the array, it alters all the others.

Do you know of a way to break this connection?  So that every element (graph) scales to its unique data.

Stephen_C
NI Employee (retired)
on

Hi Phatin,

I didn't even notice that at the time. I can't see any way to break the link, but I will have a play around with it later. If I find anything I will add it to this thread.

Stephen C
Applications Engineer
BAP_TM
Member
Member
on

Hi,

you can put XY Graph control to blank cluster control and than put cluster to an array. Then every element of array could be independently changed.

dan07
Active Participant
Active Participant
on

TMarzec, could you provide me with an example on how to adjust scales indiviually in graphs inside an array?

Thanks

dan07
Active Participant
Active Participant
on

TMarzec, could you provide me with an example on how to adjust scales indiviually in graphs inside an array?

 

Thanks

keel
Member
Member
on

Hi

I've the same problem with the the scale's where are everywhere the same. The solution from tma_lv does not work, or i miss understood his idea.

Do you have a example or a other solution for this problem?

Thanks

BAP_TM
Member
Member
on

I provided the alternative solution for creating an array of XY graph. Properties of XY graphs are common. Only displayed data could be set individually.

keel
Member
Member
on

Thanks tma_lv

I solved the problem with a image: Graphics & Sound > Picture Plots > Plot xy.vi

The picture in the Array works fine.

Remi-9
Member
Member
on

Hello, I have a related question:

I acquire a variable number of data-sets (2D array) and I want to display them using GraphsXY with a programmed control of each graph (Yaxis label, plot color, and so on).

Therefore I thought of a simple array of cluster of each graph/plot parameters and the 2D data array in a for loop. With an array of graphsXY. Data are displayed the way I want, but not the graphs/plots properties. I didnt find a solution on this post so I am wondering if this way is possible. If not, is there any other way allowing to control the graphs properties through program, without using constant?

 

Thanks for your help,

Remi.

PghFool
Member
Member
on

I like this idea and want to use it to create a set of charts with two sets of data on each: raw data shown as a scatter plot, and fit data as a line.  I see the linked chart attributes as a feature so if I want to tweak the format later, I just do it once and it applies to all 16 charts that I'm working with.  However, I'm having trouble putting a second plot on the XY Graph.  I'm working with evenly spaced data, so I'd prefer to work with waveform charts, but this post is the only one that generates the array of charts I want.  I'm not even sure how the array was generated.  If I create an indicator off the final output, I get an array of clusters, not an array of charts.  Is there a hidden trick?

Chris