BarChart
extends Element
Bar chart with one vertical bar per value in data.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| data | number[]|false | false | Values rendered as bars; initialized to a fresh table per instance |
| barColor | number | colors.lime | Color of the bar/track |
| minValue | number | 0 | Lower bound of the value axis |
| maxValue | number|false | false | false = auto (data maximum) |
| background | number|false | colors.black | Background color (false = transparent) |
| width | number | 20 | Width in terminal cells |
| height | number | 8 | Height in terminal cells |
Methods
BarChart:setup()
Initializes per-instance state and input handlers.
BarChart:render(buf)
Renders the element into the buffer.
- buf (
Render) The render buffer (local coordinates, pre-clipped)