Lightweight Charts

TradingView's high-performance financial charting library for the web.

← Back to All Libraries

Overview

TradingView's lightweight, high-performance financial charting library for candlesticks, lines, and area series.

Lightweight Charts is an open-source library from TradingView focused on financial and time-series charts. It is optimized for smooth interaction, real-time updates, and a small footprint compared with full trading terminals.

Why Choose Lightweight Charts?

  • Built for financial charts (candlestick, OHLC, area, line, baseline)
  • Excellent performance for streaming market data
  • Clean API with crosshair, markers, and price scales
  • Maintained by TradingView with strong community adoption

Real-World Applications

Widely used in crypto exchanges, brokerage dashboards, portfolio trackers, and any product that needs interactive price or time-series charts that feel like a trading terminal.

Example Charts

Live Lightweight Charts demos — area, line, and candlestick.

Area Series

Line Series

Candlestick

Example Code

Minimal getting-started snippet for Lightweight Charts.

// npm install lightweight-charts
import { createChart } from "lightweight-charts";

const chart = createChart(document.getElementById("chart"), {
  width: 420,
  height: 240,
  layout: { background: { color: "transparent" }, textColor: "#c8d0da" },
});

const series = chart.addAreaSeries({
  lineColor: "#5b9fd4",
  topColor: "rgba(91, 159, 212, 0.35)",
  bottomColor: "rgba(91, 159, 212, 0.02)",
});

series.setData([
  { time: "2024-01-01", value: 30 },
  { time: "2024-01-02", value: 42 },
  { time: "2024-01-03", value: 38 },
  { time: "2024-01-04", value: 55 },
  { time: "2024-01-05", value: 48 },
]);