tradingview /lightweight-charts
Performant financial charts built with HTML5 canvas
★ 17,862⑂ 2,713👁 203⑃ 696● 1,191▤ 51
+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|ITop issues
#621Price scale API to get/set price range20 comments · 2020-11-16#699Add option to do not connect a line/area between data gap13 comments · 2021-02-11#1933When adding a small amount of data and subscribing using subscribeVisibleTimeRangeChange, the graph crashes.10 comments · 2025-07-30#944Refactor hovering/hit test system API10 comments · 2021-12-17#1875[👾] setData Causes Visible Range Jumps and Disrupts Smooth Scrolling in Lightweight Charts9 comments · 2025-04-28#1990Series Markers misaligned on new bar7 comments · 2025-10-15#1380Width problem and persian prices7 comments · 2023-06-18#1747Chart is getting hidden if resized too small 6 comments · 2024-12-01
Discussions
#2177HTS for Mac: a read-only Korean/US stock workspace for macOS built on Lightweight Charts0 comments · 2026-10-28#2109Request for clarification on commercial use and attribution requirements for Lightweight Charts 5.20 comments · 2026-07-28#2093Adjusting the price scale1 comments · 2026-06-06#2091CandleKit — all-in-one toolkit: drawing tools, indicators, replay engine, measurement ruler, multi-pane sync, broker integration (MIT)0 comments · 2026-06-05#2089TV Logo Disabling Procedures0 comments · 2026-05-04#2078Custom marker shape (✕ cross) for loss trades — is it possible?2 comments · 2026-04-17#2074SuiBets — Using Lightweight Charts for Crypto Sports Betting Platform0 comments · 2026-04-03#2056How to make panes separators look the same?1 comments · 2026-01-27
Latest release
v5.3.0 v5.3.0 2026-11-10Enhancements - 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