PlotAttrib Table


The PlotAttrib table contains information ("attributes") about the CPlotView window. This table is returned using the GetAttrib method. Remember that table values are accesses using the cot operator, like tbl.sWindowTitle.

Syntax

PlotAttrib = CPlotView:GetAttrib()

bullet.gif    Returns a PlotAttrib table filled with attributes of the CPlotView window

bullet.gif    On failure, nil is returned.

PlotAttrib Properties

After calling CPlotView:GetAttrib(), the PlotAttrib table contains the following value in the table below. All values except nSeriesCount and nSeriesIndex are also copied into the CPlotView class properties.

Property

Default Value

Description

sWindowTitle

nil (string)

The title of the plot window.

nSeriesCount

0

The number of plot series in the plot window.

nSeriesIndex

0

The index of the current plot series. The first series in a plot window has index 1.

sCaption

nil (string)

The caption of the current plot series.

sDescription

nil (string)

An optional description of the current plot series.

sLabelX

nil (string)

The label for the plot X axis.

bPosAxisX

true

True if the X axis increases to the right.

bAutoscaleX

true

True if the X axis range is autoscaled.

nMinX

0

The minimum xalue of the X axis at the edge of the plot box.

nMaxX

0

The maximum xalue of the X axis at the edge of the plot box.

sLabelY

nil (string)

The label for the plot Y axis.

bPosAxisY

true

True if the Y axis increases to the right.

bAutoscaleY

true

True if the Y axis range is autoscaled.

nMinY

0

The minimum xalue of the Y axis at the edge of the plot box.

nMaxY

0

The maximum xalue of the X axis at the edge of the plot box.

Example

The following script returns a filled PlotAttrib table for a selected CPlotView on the Mira desktop. It then instructs the plot window to display the number of series minus 1 as the current series:

V = attachlist_plotview()

-- select the plot window froma list

if V == nil then Exit() end

-- if not successful, exit the script

tbl = V:GetAttrib()

-- get the attributes table

if tbl == nil then Exit("attributes failed") end

 

Printf("Series Count = %d\n", tbl.nSeriesCount)

-- number of series in the plot window

if nSeriesCount > nSeriesIndex then

-- if more series than current series

  V:SetIndex(nSeriesCount - 1)

-- set current series to n-1

end

 

Related Topics

CPlotView class

CPlotView:GetAttrib

CPlotView:GetIndex

CPlotView:SetIndex

CPlotView:GetTitle

CPlotView:SetTitle


Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.