BarChart
data
Color for text labels
Terminal
$termuijs render bar-chart
Installation
$ bunx termuijs add bar-chart
Copies the source into src/components/bar-chart/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { BarChart } from '@termuijs/widgets'ts
new BarChart(data: BarGroup[], style: Partial<Style> = {}, opts: BarChartOptions = {})API Reference
BarChart
| Prop | Type | Required | Description |
|---|---|---|---|
data | BarGroup[] | required | — |
direction | BarChartDirection | optional | Direction bars grow |
barWidth | number | optional | Width of each bar in cells |
barGap | number | optional | Gap between bars in a group |
groupGap | number | optional | Gap between groups |
max | number | optional | Max value for scaling |
barColor | Color | optional | Color for bars without a per-bar color |
valueColor | Color | optional | Color for value labels |
labelColor | Color | optional | Color for text labels |