Live Line Chart

NEW

A real-time line chart that scrolls right-to-left, with a large current-value readout, a live delta, and a pause control. Hover or touch the chart to freeze the stream and scrub it with a crosshair tooltip.

Requests per second

Live from the edge network. Hover to pause and inspect.

1,104req/s

▼ 7.5% over the last 60s

−60s−30snow

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/live-line-chart

API Reference

PropTypeDefaultDescription
source(push) => void | (() => void)—Data feed subscription; call push(value) for each new reading and return a cleanup
initialnumber[]—Known values, oldest to newest, spaced intervalMs apart and ending now
intervalMsnumber1000Approximate arrival interval and the smoothing delay
windowSecondsnumber60Seconds visible in the scrolling window
heightnumber220Chart height in pixels
colorstringCHART_COLORS[0]Line stroke and area gradient color
unitstring""Unit shown beside the readout and tooltip values
formatValue(n: number) => stringIntl.NumberFormatFormats the current value, tooltip, and aria text
domain[number, number]—Fixed y-range instead of auto-scaling to the visible window
showReadoutbooleantrueShows the large current value, delta, and pause button
ariaLabelstringauto-generatedAccessible description for the chart image role
classNamestring""Additional CSS classes for the chart wrapper