Different Methods for Representing Data on an XY Graph

Updated Sep 9, 2019

Reported In


  • LabVIEW

Issue Details

  • I want to write and update my XY graph, what are the different methods to do this?
  • I want to choose my own units for my XY graph, where the X axis is not time. 
  • I want to plot two Waveforms on an XY graph using NXG, one waveform is the X axis and the other is the Y axis.


There are several strategies to accomplish this. Generally, a Waveform Chart or Graph can be used to display continuous data; however, if you would like to use the XY graph, the goal is to get your data into the same format. The required data format can be seen through context help by pressing Ctrl-H and hovering your mouse over the input terminal of the XY graph.

Shown below are four different strategies for displaying the data:
  • Collect all the data into a single array using a For Loop and display the data on the XY graph in a single snapshot.

  • Save the information into an array that continuously updates, and continuously refresh the XY display.

  • Represent each XY data point in a cluster. Then, create an array of these clusters to represent an entire data set. This method makes it possible to display multiple data sets on a single XY graph.

  • Use a case statement in the while loop so that you can update the arrays of information in the same while loop, but at separate points in time. This method makes it possible to plot multiple data sets on a single XY graph, but at separate times.


If you want to plot two Waveform on an X-Y graph using NXG you can do it as shown in the Snippet below.

  • Firstly, the two Sine Waveform functions generate two Sine waves, then the Waveform properties function gets the Y values of these waves and put them in a 1 dimensional array. The build cluster function will then create a cluster of these two arrays, the first array includes the X values and the second one includes the Y values.