LineChart
data
LineChart: ASCII/Unicode line plot for a series of numbers
Terminal
$termuijs render line-chart
Installation
$ bunx termuijs add line-chart
Copies the source into src/components/line-chart/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { LineChart } from '@termuijs/widgets'ts
new LineChart(data: number[], style: Partial<Style> = {}, opts: LineChartOptions = {})API Reference
LineChart
| Prop | Type | Required | Description |
|---|---|---|---|
data | number[] | required | — |
color | Color | optional | Color of the plotted points/lines |
showYAxis | boolean | optional | Show Y-axis labels |
showXAxis | boolean | optional | Show X-axis labels |
yLabel | string | optional | Label for the Y axis |
max | number | optional | Maximum Y value (auto if not set) |
min | number | optional | Minimum Y value (auto if not set) |