KLineChart

Apache-2.0 canvas candlesticks with 27 indicators built in and zero dependencies.

Last updated

From
Free
Licence
Apache-2.0
Self-hosted
Yes
Platforms
Library

What it is

KLineChart is a candlestick-first charting library that draws to an HTML5 canvas and ships the things a trading UI actually needs, which is what separates it from the general-purpose free libraries. Version 10.0.3 registers 27 technical indicators by name and 16 drawing overlays — a Fibonacci tool, price and price-channel lines, parallel lines, straight lines, rays and segments in horizontal, vertical and free orientations, a freehand brush, and two annotation shapes. Multi-pane layouts, a crosshair, touch support and an extension API for custom indicators, overlays and figures come with it.

It has zero runtime dependencies and the UMD build is 234 KB minified, 58 KB gzipped — roughly the size of Lightweight Charts, with the indicator and drawing layer that one deliberately omits.

Liveness is good. Version 10.0.0 landed on 10 July 2026 after three betas, 10.0.3 on 27 August 2026, and the last commit on main was 15 September 2026. The repository is not archived, has about 4,150 stars and 29 open issues.

Pricing

Nothing is for sale. No pro build, no hosted service, no support contract, no commercial licence alternative; support is the GitHub issue tracker and the project's own documentation site.

The licence costs attribution, and to two parties rather than one. The published package contains LICENSE (Apache-2.0), a second licence file at licenses/LICENSE-lightweight-charts, and a NOTICE naming both KLineChart, copyright 2019 lihu, and TradingView's Lightweight Charts, copyright 2019 TradingView. Apache-2.0 clause 4(d) obliges you to carry that NOTICE into anything you distribute — so shipping KLineChart means shipping a TradingView attribution, even though this is not a TradingView project.

Data & coverage

None. applyNewData and updateData take arrays of timestamped OHLCV objects and that is the whole contract; the library makes no network request and knows nothing about symbols, exchanges or sessions. Pair it with a market-data provider you already have.

Integrations

klinecharts on npm, or a UMD bundle from unpkg or jsDelivr for a plain script tag. There is no first-party React, Vue or Angular wrapper — the documented pattern is to create the chart in an effect against a div you own, which works everywhere and is one of the benefits of having no dependencies. Documentation is published in English and Chinese, with versioned trees for 10.x, 9.x and 8.x.

Limitations

  • Version 10 is a rewrite, and the upgrade is not free. Three major versions are documented side by side precisely because the API moved; budget for a port rather than a bump.
  • The Pro package is dormant. @klinecharts/pro, which supplies the symbol search, period picker, watchlist and datafeed interface that the core library has none of, last shipped in March 2023. Everything above the chart is yours to build.
  • The drawing set is geometric, not analyst-grade. One Fibonacci tool, no pitchfork, no Elliott wave, no Gann. Sixteen overlays against the 110-odd a hosted charting product advertises.
  • No indicator templates, no saved layouts, no order entry, no alerts. This is a chart, not a terminal.
  • Documentation is translated and thin in places. The English tree covers the API but the worked examples and community answers skew Chinese, which is a real cost when you are debugging an extension.
  • Accessibility is whatever canvas gives you, which is nothing. No ARIA surface, no accessibility page in the docs.

Alternatives

Lightweight Charts is the same licence and roughly the same size, and is the better choice when you want a renderer and intend to build the analysis layer yourself. TradingView Advanced Charts has vastly more of both, free, if your company ships a free public product and can live with closed source. Highcharts Stock, AnyStock and SciChart.js all charge per developer. Apache ECharts is Apache-2.0 too but has a candlestick series and no indicators at all.

Specs

Interfaces
JavaScript/TypeScript
Export
None
Asset classes
Markets
Platforms
Library
AI features
None
Capabilities
Charting
Pricing verified
Capabilities verified
Coverage verified

Also worth comparing

  • Apache EChartsApache-2.0 general-purpose charting with a candlestick series and nothing else financial.
  • Lightweight ChartsThe chart and nothing else — six series types on canvas, attribution required.
  • Plotly.jsCandlestick and OHLC traces in an MIT library the notebook already has installed.
  • amCharts 5 Stock ChartLinkware — free in commercial products as long as the amCharts link stays on the chart.
  • AnyStockPer-product, per-domain commercial licensing with a watermark until you pay.
  • Highcharts StockCommercial JS financial charting — 48 indicators, a navigator, a per-seat licence.

FAQ

Can I use KLineChart in a commercial product for free?

Yes. The LICENSE file in the published package is Apache-2.0 verbatim, with no additional grant or restriction. There is nothing to buy and no paid edition.

Do I owe anyone attribution?

Yes, and to two parties. The NOTICE file credits both KLineChart and TradingView's Lightweight Charts, and the package carries a second copy of the Apache licence at licenses/LICENSE-lightweight-charts. Apache-2.0 clause 4(d) requires you to reproduce that NOTICE in anything you distribute.

How many indicators does it actually ship?

Twenty-seven, registered by name in the 10.0.3 bundle — AO, AVP, BBI, BIAS, BOLL, BRAR, CCI, CR, DMA, DMI, EMA, EMV, KDJ, MA, MACD, MTM, OBV, PSY, PVT, ROC, RSI, SAR, SMA, TRIX, VOL, VR and WR. Custom indicators register through the same extension API.

Is KLineChart Pro a paid version?

No, and it is not really maintained either. @klinecharts/pro is a separate Apache-2.0 package that wraps the library in a full trading UI with a datafeed interface, but its last npm publish was 0.1.1 in March 2023 and its last commit May 2023. Treat it as a reference implementation, not a dependency.