LitDev Extension API

LD3DView LDArray LDBits LDBlueTooth LDCall
LDChart LDClient LDClipboard LDColours LDCommPort
LDController LDControls LDCursors LDDataBase LDDateTime
LDDebug LDDialogs LDDictionary LDEffect LDEmail
LDEncryption LDEvents LDFastArray LDFastShapes LDFigures
LDFile LDFocus LDftp LDGraph LDGraphicsWindow
LDHID LDImage LDInline LDIOWarrior LDList
LDLogic LDMath LDMathX LDMatrix LDMusic
LDNetwork LDPhysics LDProcess LDQueue LDRegex
LDResources LDScrollBars LDSearch LDServer LDSettings
LDShapes LDShell LDSort LDSound LDSpeech
LDStatistics LDStopwatch LDText LDTextWindow LDTimer
LDTranslate LDUnits LDUtilities LDWaveForm LDWebCam
LDWindows LDxml LDZip

LDGraph
Graphing utility.

AddGraph AddSeriesHistogram AddSeriesLine
AddSeriesPoints AutoScale AxesColour
AxesResolution BorderColour CreateTrend
DeleteSeries ExportCSV GridColour
GridLinesX GridLinesY Help
InteriorColour RestartEvents ScaleAxisX
ScaleAxisY StopEvents TextColour
TrendCoef TrendPointCount

AddGraph(xpos,ypos,width,height,title,labelX,labelY)
Create a graph.
xpos The graph left position.
ypos The graph right position.
width The graph width.
height The graph height.
title The graph title.
labelX The X axis label.
labelY The Y axis label.
returns The graph name.

AddSeriesHistogram(graphName,seriesLabel,data,colour)
Add a new data series to an existing graph as a histogram.
graphName The graph name.
seriesLabel The series label.
If a series with this label already exists then it is replaced with this series.

data An array holding the X and Y coordinate data.

For example, a line with points (0,1) and (2,3) would have
data[0] = 1
data[2] = 3

More generally data[x] = y.

colour The colour of the series data.
returns None.

AddSeriesLine(graphName,seriesLabel,data,colour)
Add a new data series to an existing graph as a line graph.
graphName The graph name.
seriesLabel The series label.
If a series with this label already exists then it is replaced with this series.

data An array holding the X and Y coordinate data.

For example, a line with points (0,1) and (2,3) would have
data[0] = 1
data[2] = 3

More generally data[x] = y.

colour The colour of the series data.
returns None.

AddSeriesPoints(graphName,seriesLabel,data,colour)
Add a new data series to an existing graph as points.
graphName The graph name.
seriesLabel The series label.
If a series with this label already exists then it is replaced with this series.

data An array holding the X and Y coordinate data.

For example, a line with points (0,1) and (2,3) would have
data[0] = 1
data[2] = 3

More generally data[x] = y.

colour The colour of the series data.
returns None.

AutoScale
AutoScale axes "True" (default) or "False".
When set to "False" early version scaling is used.


AxesColour
The boundary axes and tick mark colour.

AxesResolution
The axes (min and max value) significant figures (default 2).

BorderColour
The border colour.

CreateTrend(data,order)
Create a trend from data.
data An array holding the X and Y coordinate data.

For example, a line with points (0,1) and (2,3) would have
data[0] = 1
data[2] = 3

More generally data[x] = y.

order The polynomial order for the trend line.
1 is linear.
2 is quadratic.

returns A data array holding a trend that may be plotted.

DeleteSeries(graphName,seriesLabel)
Delete an existing series on existing graph.
graphName The graph name.
seriesLabel The series label name to delete.
returns None.

ExportCSV(data,fileName)
Export data series directly to CSV file (no graphing).
data An array holding the X and Y coordinate data.
fileName The CSV output file name.
returns None.

GridColour
The internal scale grid lines colour.

GridLinesX
The number of X axes tick marks and grid lines (default 10)

GridLinesY
The number of Y axes tick marks and grid lines (default 10)

Help()
This function is just to display this help.

Graphs of data can be plotted as lines, points or histograms.

Each series of data is a SmallBasic array with the array index reprenting the (unique) X value and the array value representing the Y value.

For example:
data[1] = 5
data[2] = 8
data[3] = 3

First create a graph object with AddGraph, then add series with AddSeriesLine, AddSeriesHistogram or AddSeriesPoints.

Once a graph is created and plotted, the axes can be grabbed and scrolled where the hand cursor appears. The legend can also be moved.

The graph can be rescaled by using the left mouse button to select a region to zoom, or the mouse wheel can be used to zoom the display. A double click will reset the scaling to the original default.

A right click will bring up a menu with other features like export of image or data, displaying the cursor coordinates, hiding the legend etc.

Finally the various parmeters for this method give further control of the plotting colours and behaviour.

returns None.

InteriorColour
The interior colour.

RestartEvents()
Restart all the graph left click mouse events.
returns None.

ScaleAxisX(graphName,min,interval,max)
Set the X axis scaling.
This over-rides any automatic methods.

graphName The graph name.
min The X axis minimum value.
interval The grid spacing interval.
If this value is 0 then the interval is calculated from the data.

max The X axis maximum value.
If this value is equal to min, then the maximum is calculated from the data.
If this value is less than min, then both the minimum and maximum are calculated from the data.


ScaleAxisY(graphName,min,interval,max)
Set the Y axis scaling.
This over-rides any automatic methods.

graphName The graph name.
min The Y axis minimum value.
interval The grid spacing interval.
If this value is 0 then the interval is calculated from the data.

max The Y axis maximum value.
If this value is equal to min, then the maximum is calculated from the data.
If this value is less than min, then both the minimum and maximum are calculated from the data.


StopEvents()
Stop all the graph left click mouse events.
returns None.

TextColour
The text colour.

TrendCoef()
Get the polynomial trend line coefficients for the last calculated trend using CreateTrend.
returns An array 'coef' of the polynomial coefficients for the trend line.
The number of coefficients in the array is one larger than the order used to create the trend (order+1) and is indexed from 0.
y = coef[0] + coef[1]x + coef[2]x^2 ...


TrendPointCount
Set or get the number of points created for a trend line using CreateTrend.
Default 50.