tradingview /lightweight-charts

Performant financial charts built with HTML5 canvas

★ 17,862⑂ 2,713👁 203⑃ 696● 1,191▤ 51
TypeScriptApache-2.0Created 2019-05-24www.tradingview.com/lightweight-charts/
Download: v5.3.0v5.3.0 ↓5.3.02026-11-10
+6
Daily
17,862
stars
2,713
forks
203
watchers
696
prs
1,191
issues
51
releases

README

Lightweight Charts™

  [![CircleCI][ci-img]][ci-link]
  [![npm version][npm-version-img]][npm-link]
  [![npm bundle size][bundle-size-img]][bundle-size-link]
  [![Dependencies count][deps-count-img]][bundle-size-link]
  [![Downloads][npm-downloads-img]][npm-link]
  [![pkg.pr.new][pkg-pr-new-img]][pkg-pr-new-link]




[Demos][demo-url] | Documentation | Reddit

TradingView Lightweight Charts™ are one of the smallest and fastest financial HTML5 charts.

The Lightweight Charts™ library is the best choice for you if you want to display financial data as an interactive chart on your web page, or replace static image charts with interactive ones. It does this without affecting your web page's loading speed and performance.
The size of the library is close to static images but if you have dozens of image charts on a web page then using this library can make the size of your web page smaller.

The library provides a rich set of charting capabilities out of the box, but you can also extend its functionality by building custom plugins. Browse the plugin catalog for ready-made plugins, or see the interactive plugin examples and plugin-examples/README.md to build your own.

Take a look at awesome-tradingview for related projects created by our community members.

 Installing

 es6 via npm

bash
npm install lightweight-charts


 Latest master build

To try the latest master build without waiting for a release (powered by pkg.pr.new):

bash
npm install https://pkg.pr.new/lightweight-charts@master


The import and usage below applies to both npm installation options:

js
import { createChart, LineSeries } from 'lightweight-charts';

const chart = createChart(document.body, { width: 400, height: 300 });
const lineSeries = chart.addSeries(LineSeries);
lineSeries.setData([
    { time: '2019-04-11', value: 80.01 },
    { time: '2019-04-12', value: 96.63 },
    { time: '2019-04-13', value: 76.64 },
    { time: '2019-04-14', value: 81.89 },
    { time: '2019-04-15', value: 74.43 },
    { time: '2019-04-16', value: 80.01 },
    { time: '2019-04-17', value: 96.63 },
    { time: '2019-04-18', value: 76.64 },
    { time: '2019-04-19', value: 81.89 },
    { time: '2019-04-20', value: 74.43 },
]);


 CDN

You can use unpkg:



The standalone version creates window.LightweightCharts object with all exports from esm version:

js
const chart = LightweightCharts.createChart(document.body, { width: 400, height: 300 });
const lineSeries = chart.addSeries(LightweightCharts.LineSeries);
lineSeries.setData([
    { time: '2019-04-11', value: 80.01 },
    { time: '2019-04-12', value: 96.63 },
    { time: '2019-04-13', value: 76.64 },
    { time: '2019-04-14', value: 81.89 },
    { time: '2019-04-15', value: 74.43 },
    { time: '2019-04-16', value: 80.01 },
    { time: '2019-04-17', value: 96.63 },
    { time: '2019-04-18', value: 76.64 },
    { time: '2019-04-19', value: 81.89 },
    { time: '2019-04-20', value: 74.43 },
]);


 Build variants

|Dependencies included|Mode|ES module|I

Top issues

Discussions

Latest release

v5.3.0 v5.3.0 2026-11-10
Enhancements

- Added hitTestTolerance option to PriceLineOptions, which controls how many pixels beyond a price line's stroke still count as a hit when hovering. This was previously fixed at 7px, so closely stacked price lines could register hovers for their neighbours. The default stays at 7, matching the previous behaviour, and the name matches the series-level hitTestTolerance option. (PR 2081, fixes 1610, contributed by @sahil-tandon)
- Improved curved line rendering (LineType.Curved) by replacing the Catmull-Rom interpolation with the Fritsch-Carlson monotone algorithm. The curve no l

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON