Manually Clear Data
This method can be used on Charts or Graphs. For simplicity, the term Graph is used below.
- Open your LabVIEW VI that contains a Waveform Graph object.
- On the Front Panel, right-click the Graph select Data Operations>>Clear Graph.
Programmatically Clear Data
There are multiple methods to programmatically clear data from a chart or graph. You can clear the Front Panel object using specific property nodes depending on whether a Waveform Chart or Waveform Graph is used. For either data type, you can use the Reinitialize to Default property node.
Chart
You can clear a chart programmatically by writing an empty array to its History Data buffer:
- On the block diagram, right-click the chart icon select Create>>Property Node>>History Data - LabVIEW Help.
- Note that the color at the top bar of the property node is determined by the data type used in the chart.
- Right-click the History Data property node and select Change to Write.
- Right-click the History Data Terminal and select Create Constant.
This writes an empty array of data to the chart, which will clear the history when this code is executed.
Graph
You can clear a graph programmatically by writing an empty array to its Value property:
- Make sure the graph is clear by right-clicking the graph and choosing Data Operations>>Clear Graph.
- Right-click the graph and select Create>>Property Node>>Value.
- Right-click Value and select Change to Write.
- Right-click the Value Terminal and select Create Constant.
This writes empty data to the graph which will clear the graph when this code is executed.
Reinitialize to Default
You can also use the
Reinitialize to Default method if you ensure that the default value for your graph or chart is an empty array:
- Make sure the graph/chart is clear by right-clicking the object in the front panel select Data Operations>>Clear Graph or Clear Chart.
- Set this empty state as default by right-clicking the graph/chart select Data Operations>>Make Current Value Default.
- On the block diagram, right-click the graph/chart and select Create>>Invoke Node>>Reinitialize to Default.
This method returns the front panel object to its default state.