Chart Control

Chart numeric data by displaying a history of values.

1378

How is Charting Different Than Plotting?

Graphs and charts differ in the way they display and update data. VIs with a graph usually collect the data in an array and then plot the data to the graph. This process is similar to a spreadsheet that first stores the data then generates a plot of it. When the data is plotted, the graph discards the previously plotted data and displays only the new data.

In contrast, a chart appends new data points to those points already in the display to create a history or a buffer. On a chart, you can see the current reading or measurement in context with data previously acquired. When more data points are added than can be displayed on the chart, the chart scrolls so that new points are added to the right side of the chart while old points disappear to the left.

What Types of Data Can I Chart?

You can chart numeric data contained in arrays and analog waveforms. By default, the chart data type is an array of doubles. You can change the data type on the diagram.

The waveform data type carries the start time (t0), delta t (dt), and y-values (Y) of a waveform. When you wire waveform data to a chart, the chart automatically plots a waveform based on the start time, delta t, and y-values of the waveform. A waveform that specifies t0 and a single-element Y array is useful for plotting data that is not evenly sampled because each data point has its own time stamp.

For data contained in arrays, the chart displays a general-purpose Cartesian graph that charts any set of points, evenly sampled or not.

The following table describes how different types of array data are charted.

Data Type Plot Behavior
Scalar numeric value The chart displays a single plot using the scaler numeric value as the most recent value and previous values up to the history length.
1D array of numeric values

The array is a single plot.

  • X-value: Array index
  • Y-value: Array element
Cluster of numeric values Each element of the cluster is a single plot which uses the numeric value as the most recent value and previous values up to the history length.
1D array of clusters of numeric values Each element of the cluster is a single plot which uses the numeric value as the most recent value and previous values up to the history length. The array represents an aggregated set of samples.
1D array of waveforms Each waveform is a separate plot. This data type is not supported.
2D array of numeric values Each column of the array is a separate plot.

How Do I Define the Chart History Length?

On the Item tab, in the Behavior section, specify History length to configure the size of the buffer. For waveforms, the history length is the number of individual waveforms the buffer can hold. The waveforms can be of various sample sizes. For numeric data, the history length is the number of samples the buffer can hold.