Plotly.js

Candlestick and OHLC traces in an MIT library the notebook already has installed.

by Plotly

Last updated

From
Free
Licence
MIT
Self-hosted
Yes
Platforms
Library

What it is

Plotly.js draws a chart from a JSON figure — traces, a layout, a config — into a div. It is also the renderer underneath Plotly's Python and R packages, which is why most people meet it without choosing it: fig.show() in a notebook is this library, and the bindings are serialisers over the same figure spec. This card covers the library and those bindings as one product. Dash and Dash Enterprise are not this card.

For a price chart it gives you two purpose-built trace types, candlestick and ohlc, on a real date axis with rangeselector buttons (1m, 6m, YTD, all) and a range slider that candlestick charts switch on by default. A volume panel is a second y-axis with its own domain, or a second row from make_subplots(shared_xaxes=True) in Python, linked with matches.

Maintenance is not in question: 4.1.0 shipped on 8 September 2026, 4.0.0 on 24 August, and the last commit on main landed on 13 September 2026. Version 4 was breaking — Mapbox traces removed, MathJax 2 dropped, Node 22 the minimum, colour parsing moved to culori, TypeScript declarations now shipped — so pin it. plotly 7.0.0 on PyPI and 4.12.1 on CRAN track it.

Pricing

Free, with nothing to buy. The vendor's own "Is Plotly.js Free?" page states that the library is MIT-licensed, costs nothing to install and use, works offline and needs no account or token. Plotly's pricing page sells Plotly Studio and Plotly Cloud seats — $0, $29 per creator seat per month, contact-sales Enterprise — plus Dash Enterprise. None of it gates a library feature, which is why this card carries no tiers.

One caveat arrived with version 4: showSendToCloud now defaults to true and plotlyServerURL to cloud.plotly.com, so the default mode bar carries a button that uploads the figure's data to Plotly after a confirmation step. Set showSendToCloud: false if that is not wanted.

Data & coverage

None at all. Plotly.js ships no quotes, no bars and no symbols — you hand it arrays — and no market calendar either, which is the root of the weekend problem below.

Integrations

The full bundle is 9.57 MB raw, 4.29 MB minified, 1.33 MB minified and gzipped. The finance partial bundle — bar, candlestick, funnel, funnelarea, histogram, indicator, ohlc, pie, scatter, waterfall — is 3.18 MB, 1.28 MB and 432 kB on those same measures, and ships as plotly.js-finance-dist with no dependencies.

For live data, Plotly.extendTraces appends points with an optional per-trace cap and is documented as faster than a redraw; Plotly.react diffs a new figure against the old. In Python, NumPy and Polars arrays are base64-encoded into typed arrays rather than JSON lists. Static output is Plotly.toImage and Plotly.downloadImage, PNG or SVG.

Limitations

  • Weight. 432 kB gzipped for the finance bundle, 1.33 MB for the full one — an order of magnitude more than a purpose-built financial charting library.
  • The weekend gap is the default. A date axis is real time, so daily bars leave flat holes across Saturdays, holidays and the overnight session until you configure rangebreaks — and the holiday list is yours to maintain, per exchange, forever.
  • Rangebreaks and WebGL are mutually exclusive. Plotly's docs say plainly that range breaks on time-series axes are not supported on scattergl, and Plotly Express silently switches to scattergl above 1,000 rows unless you pass render_mode="svg".
  • No indicators, no crosshair convention, no symbol search, no session shading. Moving averages, RSI and Bollinger bands are traces you compute and add yourself. Drawing is five opt-in mode bar buttons producing layout shapes that neither snap to price nor survive a reload.
  • Browsers cap WebGL contexts at 8 to 16, so 4 to 8 GL figures per page, and GL traces export as a raster inside an SVG or PDF.
  • Accessibility is poor. The SVG carries no ARIA roles on the data, and the project's own screen-reader tracking issue has been open since March 2024. The repo had 705 open issues on 13 September 2026.
  • Mouse-wheel zoom is off by default on cartesian subplots, and a visible range slider forces the perpendicular axis to fixedrange, so there is no y-axis zoom while the slider shows.

Alternatives

Lightweight Charts is the opposite trade: roughly a tenth of the weight, built for price series and nothing else. Highcharts Stock ships the indicators and a navigator but needs a commercial licence. Apache ECharts is the other large permissive library with a candlestick type. uPlot is the minimal choice when the chart is one long line. In Python, for a chart bound for a PDF rather than a browser, mplfinance draws the same bars in matplotlib at a fraction of the payload.

Specs

Interfaces
Python, JavaScript, with first-party Python and R bindings
Export
JSON
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.
  • KLineChartApache-2.0 canvas candlesticks with 27 indicators built in and zero dependencies.
  • Lightweight ChartsThe chart and nothing else — six series types on canvas, attribution required.
  • 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

Does Plotly.js cost anything to use commercially?

No. The LICENSE file in the repository is a plain MIT licence, and every one of the library's 42 runtime dependencies is MIT, BSD-3-Clause, ISC or Zlib. Nothing about the library is gated behind an account, a token or a plan. What Plotly sells is Plotly Studio, Plotly Cloud and Dash Enterprise, which are separate products.

How do I get rid of the flat weekend gaps on a daily chart?

Set layout.xaxis.rangebreaks. {bounds: ['sat', 'mon']} removes weekends, {pattern: 'hour', bounds: [17, 8]} removes the overnight session, and {values: [...]} removes named holidays, which is a list you maintain yourself per exchange. Rangebreaks only apply to date-type axes and, per Plotly's own docs, are not supported on scattergl traces.

How many bars will it draw before it slows down?

Plotly has no WebGL candlestick or OHLC trace, so a price chart is SVG at any size and each bar is its own path. The GL path only helps for line and scatter — Plotly's own documentation demonstrates scattergl at a million points and says WebGL traces top out around there. We did not measure where the SVG version stalls.

Is Dash part of this?

No. Dash is Plotly's separate open-source Python app framework, and Dash Enterprise is the commercial platform that hosts it. This card is the charting library — the thing you get from a script tag, from pip install plotly, or from CRAN.