Graph
This is the base class for all graph elements. It is a point based graph.
Extends: VisualElement
Properties
Property | Type | Default | Description |
---|---|---|---|
minValue | number | 0 | The minimum value of the graph |
maxValue | number | 100 | The maximum value of the graph |
series | table | {} | The series of the graph |
Functions
Method | Returns | Description |
---|---|---|
Graph:addSeries | Graph | Adds a series to the graph |
Graph:removeSeries | Graph | Removes a series from the graph |
Graph:getSeries | series | Gets a series from the graph |
Graph:changeSeriesVisibility | Graph | Changes the visibility of a series |
Graph:addPoint | Graph | Adds a point to a series |
Graph:focusSeries | Graph | Focuses a series |
Graph:setSeriesPointCount | Graph | Sets the point count of a series |
Graph:clear | Graph | Clears all points from a series |
Graph:addSeries(name, symbol, bgCol, fgCol, pointCount)
Parameters
name
string
The name of the seriessymbol
string
The symbol of the seriesbgCol
number
The background color of the seriesfgCol
number
The foreground color of the seriespointCount
number
The number of points in the series
Returns
Graph
self
The graph instance
Graph:removeSeries(name)
Parameters
name
string
The name of the series
Returns
Graph
self
The graph instance
Graph:getSeries(name)
Parameters
name
string
The name of the series
Returns
series
The
series
Graph:changeSeriesVisibility(name, visible)
Parameters
name
string
The name of the seriesvisible
boolean
Whether the series should be visible
Returns
Graph
self
The graph instance
Graph:addPoint(name, value)
Parameters
name
string
The name of the seriesvalue
number
The value of the point
Returns
Graph
self
The graph instance
Graph:focusSeries(name)
Parameters
name
string
The name of the series
Returns
Graph
self
The graph instance
Graph:setSeriesPointCount(name, count)
Parameters
name
string
The name of the seriescount
number
The number of points in the series
Returns
Graph
self
The graph instance
Graph:clear(name?)
Clears all points from a series
Parameters
name
(optional)string
The name of the series
Returns
Graph
self
The graph instance