Files
Basalt2/docs/references/elements/Graph.md
Robert Jelic 3504d8a3aa Docs fix
2025-09-13 12:50:01 +02:00

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

  • Graph self The newly created Graph instance

Graph:Graph(props, basalt)

Parameters

  • props table The properties to initialize the element with
  • basalt table The basalt instance

Returns

  • Graph self The initialized instance

Graph:Graph(name, symbol, bgCol, fgCol, pointCount)

Parameters

  • name string The name of the series
  • symbol string The symbol of the series
  • bgCol number The background color of the series
  • fgCol number The foreground color of the series
  • pointCount number The number of points in the series

Returns

  • Graph self The graph instance

Graph:Graph(name)

Parameters

  • name string The name of the series

Returns

  • Graph self The graph instance

Graph:Graph(name)

Parameters

  • name string The name of the series

Returns

  • series The series

Graph:Graph(name, visible)

Parameters

  • name string The name of the series
  • visible boolean Whether the series should be visible

Returns

  • Graph self The graph instance

Graph:Graph(name, value)

Parameters

  • name string The name of the series
  • value number The value of the point

Returns

  • Graph self The graph instance

Graph:Graph(name)

Parameters

  • name string The name of the series

Returns

  • Graph self The graph instance

Graph:Graph(name, count)

Parameters

  • name string The name of the series
  • count number The number of points in the series

Returns

  • Graph self The graph instance

Graph:Graph(name?)

Clears all points from a series

Parameters

  • name (optional) string The name of the series

Returns

  • Graph self The graph instance

Graph:Graph()