2.9 KiB
2.9 KiB
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.new | Graph | Creates a new Graph instance |
| Graph:Graph | Graph | Initializes the Graph instance |
| Graph:Graph | Graph | Adds a series to the graph |
| Graph:Graph | Graph | Removes a series from the graph |
| Graph:Graph | series | Gets a series from the graph |
| Graph:Graph | Graph | Changes the visibility of a series |
| Graph:Graph | Graph | Adds a point to a series |
| Graph:Graph | Graph | Focuses a series |
| Graph:Graph | Graph | Sets the point count of a series |
| Graph:Graph | Graph | Clears all points from a series |
| Graph:Graph | - | Renders the graph |
Graph.new()
Creates a new Graph instance
Returns
GraphselfThe newly created Graph instance
Graph:Graph(props, basalt)
Parameters
propstableThe properties to initialize the element withbasalttableThe basalt instance
Returns
GraphselfThe initialized instance
Graph:Graph(name, symbol, bgCol, fgCol, pointCount)
Parameters
namestringThe name of the seriessymbolstringThe symbol of the seriesbgColnumberThe background color of the seriesfgColnumberThe foreground color of the seriespointCountnumberThe number of points in the series
Returns
GraphselfThe graph instance
Graph:Graph(name)
Parameters
namestringThe name of the series
Returns
GraphselfThe graph instance
Graph:Graph(name)
Parameters
namestringThe name of the series
Returns
seriesTheseries
Graph:Graph(name, visible)
Parameters
namestringThe name of the seriesvisiblebooleanWhether the series should be visible
Returns
GraphselfThe graph instance
Graph:Graph(name, value)
Parameters
namestringThe name of the seriesvaluenumberThe value of the point
Returns
GraphselfThe graph instance
Graph:Graph(name)
Parameters
namestringThe name of the series
Returns
GraphselfThe graph instance
Graph:Graph(name, count)
Parameters
namestringThe name of the seriescountnumberThe number of points in the series
Returns
GraphselfThe graph instance
Graph:Graph(name?)
Clears all points from a series
Parameters
name(optional)stringThe name of the series
Returns
GraphselfThe graph instance