3.12 Plotting Data

This example shows how to create a graph and plot worksheet data to it.

The block below is for creating a new project with a empty graph (OA_NewEmptyGraph), then create a new empty worksheet (OA_NewWorksheet). The Worksheet refnum is then used to call Origin COM property (Worksheet.Cols) to set the 2-column worksheet.

Labview Example4 1.png

A FOR loop is then used to set both two Y columns (OA_Col-Setting.vi), and with Even Sampling (OA_Col-SetEvenSampling.vi) so that we don't need X columns to make plots. Also it fills both columns with some sample data, in the form of Guassian peak.

Labview Example4 2.png

The block below is for plotting(OA_PlotWksCols) the sample data into the graph layer created earlier and to get the GraphPage refnum to use invoke node to call the Activate method, so as to bring the graph to the front.

Labview Example4 3.png