LCLiveCharts

Demo

Interactive LiveCharts walkthrough — every major feature with Vue snippets

LiveCharts is a real-time animated charting library with a framework-agnostic canvas engine and Vue 3 bindings. One <canvas>, smooth interpolation at 60fps.

Live previews use the shared engine via React bindings; copy the Vue snippets below.

Degen mode (chart shake and particles) with momentum arrows.

Everything else is opt-in: momentum, orderbook, candlesticks, multi-series, particles.

Getting started

npm install livecharts

The component fills its parent. Set a height on the wrapper.

<script setup lang="ts">
import { LiveChart } from "livecharts/vue";
</script>

<template>
  <div style="height: 200px">
    <LiveChart :data="data" :value="value" />
  </div>
</template>

data is an array of { time, value } points (unix seconds). value is the latest number.

Two props. That's it.

Feed it however you like — WebSocket, polling, random walk. LiveCharts interpolates between updates.

Resting heart rate. Custom formatter, exaggerated Y-axis.

Momentum

The momentum prop adds directional arrows to the live tip. Pass true to auto-detect, or force "up" / "down" / "flat".

Arrows fade out fully before the new direction fades in.

Value overlay

showValue renders the current value as a large number over the chart via DOM. Pair with valueMomentumColor to tint by direction.

60fps value overlay with momentum colouring.

Time windows

Pass a windows array for horizon buttons. Styles: "default", "rounded", "text". Listen with @window-change.

<LiveChart
  :windows="[
    { label: '1m', secs: 60 },
    { label: '5m', secs: 300 },
  ]"
  window-style="rounded"
  @window-change="(secs) => (horizon = secs)"
/>

CPU usage with occasional spikes. Rounded time windows.

Reference line

referenceLine={{ value, label? }} draws a horizontal threshold.

Polymarket-style prediction line. "Will Bitcoin stay above $67,500?"

Orderbook

Pass orderbook with bids / asks as [price, size][]. Labels spawn, drift, and fade — speed reacts to momentum and churn.

Kalshi-style orderbook stream. Bid and ask sizes float upward behind the price line.

Candlestick

OHLC candles with a live forming candle. Built-in toggle morphs between line and candle views — listen with @mode-change.

Same data, two views. The toggle morphs between line and candlestick.

Multi-series

Pass series to draw overlapping lines with toggle chips. Listen with @series-toggle.

Prediction market. Three outcomes, always summing to 100%. Click the chips to toggle lines.

States

loading shows a breathing placeholder that morphs into data. paused freezes the view; resume fades or morphs depending on how long you were away.

Loading state, then data arrives. Loops every 9 seconds.

Theming

Pass any CSS color to color — LiveCharts derives the palette. theme switches light / dark chrome.

Dark theme. Same component, different colour.

More features

  • exaggerate — tighten Y-range for small moves
  • scrub — crosshair tooltips (on by default)
  • degen — particles + shake on swings
  • badge-variant="minimal" or :badge="false"

How it works

One canvas, one requestAnimationFrame loop. Display state lerps toward new values (lerpSpeed, default 0.08). The Y-range snaps outward instantly so the line is never clipped.

Stress testing

Charts that only look good on calm data are not useful.

Wild swings, fast updates (100ms)

Near-flat, ultra-low volatility, exaggerate (150ms)

Chaotic, huge spikes (80ms)

Sharp reversals, isolated spikes, and chaos:

Frequent sharp reversals (60ms updates)

Near-flat with massive isolated spikes (120ms)

Rapid zigzag oscillation (50ms)

Irregular arrival — gaps and bursts:

Just a line

If you only want a line that moves when a number changes:

Next steps

On this page