Skip to content

LineChart

widgetsdata

LineChart: ASCII/Unicode line plot for a series of numbers

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

PropTypeRequiredDescription
datanumber[]required
colorColoroptionalColor of the plotted points/lines
showYAxisbooleanoptionalShow Y-axis labels
showXAxisbooleanoptionalShow X-axis labels
yLabelstringoptionalLabel for the Y axis
maxnumberoptionalMaximum Y value (auto if not set)
minnumberoptionalMinimum Y value (auto if not set)
#data#line-chart