# Plotly.js

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

*https://stockmarketstack.com/tools/plotly-js · JavaScript Charting Libraries for Finance*

## Facts

### At a glance

| Field | Value |
| --- | --- |
| Vendor | Plotly |
| Category | JavaScript Charting Libraries for Finance |
| Job | charting_library |
| Website | https://plotly.com/javascript/ |
| Pricing model | open-source |
| Free tier | true |
| Open source | true |
| Licence | MIT |
| Self-hosted | true |
| Tested hands-on | false |
| Last updated | 2026-09-13 |

### Coverage

| Field | Value |
| --- | --- |
| Asset classes | none |
| Markets | none |
| Works outside the US | false |
| Data latency | none |
| Platforms | library |
| AI features | none |

### Interfaces

| Field | Value |
| --- | --- |
| API | false |
| Webhooks | false |
| Scripting | JavaScript, with first-party Python and R bindings |
| Python | true |
| Spreadsheet add-in | false |
| MCP server | false |
| Export | json |

### Capabilities

Yes: charting

No: screening, scanning, backtesting, automation, live_trading, paper_trading, portfolio_tracking, broker_import, tax_reporting, alerts, news, options_analysis

*Verified: pricing 2026-09-13; capabilities 2026-09-13; coverage 2026-09-13.*

## 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](https://stockmarketstack.com/tools/lightweight-charts) is the opposite trade: roughly a tenth of the weight, built for price series
and nothing else. [Highcharts Stock](https://stockmarketstack.com/tools/highcharts-stock) ships the indicators and a navigator but needs a commercial
licence. [Apache ECharts](https://stockmarketstack.com/tools/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.

## 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.

## Also worth comparing

- [Apache ECharts](https://stockmarketstack.com/tools/echarts.md) — Apache-2.0 general-purpose charting with a candlestick series and nothing else financial.
- [KLineChart](https://stockmarketstack.com/tools/klinechart.md) — Apache-2.0 canvas candlesticks with 27 indicators built in and zero dependencies.
- [Lightweight Charts](https://stockmarketstack.com/tools/lightweight-charts.md) — The chart and nothing else — six series types on canvas, attribution required.
- [amCharts 5 Stock Chart](https://stockmarketstack.com/tools/amcharts-stock-chart.md) — Linkware — free in commercial products as long as the amCharts link stays on the chart.
- [AnyStock](https://stockmarketstack.com/tools/anystock.md) — Per-product, per-domain commercial licensing with a watermark until you pay.
- [Highcharts Stock](https://stockmarketstack.com/tools/highcharts-stock.md) — Commercial JS financial charting — 48 indicators, a navigator, a per-seat licence.
