InsertPlot Method (AChart)

Inserts a Plot object on the object.

Syntax

[ lInsertPlot = ] Object.InsertPlot ( vPlot )

The InsertPlot method syntax has the following parts:

 

Name

Type

Description

Object

AChart

AChart control

lInsertPlot

Long

Insert a plot object in the object at a position specified by vPlot.

vPlot

Val Variant

Either the name of the plot object or the zero-based index of the object in the array where the new plot is inserted.

Comments

If vPlot is not valid (for example -1), then the plot is appended to the end of the list. Otherwise, the plot will be inserted before the specified plot in the array. The return value is the zero-based index of the plot on the chart. If an error occurs, for example, there is insufficient space to store the new plot, the return value is -1.

Example

The following example will insert a plot in the AChart before the first plot:

cht1.InsertPlot(0)

The following example will insert a plot in the AChart before the "Voltage" plot:

cht1.InsertPlot("Voltage")

The following example will append a plot in the AChart after the last plot:

cht1.InsertPlot(-1)

Applies to

AChart

See Also

APlot, Axes, Plots, RemovePlot