npm / lightweight-charts
lightweight-charts
What changed in lightweight-charts 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
4 breaking12 new APIs and options3 performance2 behavior and defaults2 tooling23 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initlightweight-charts 546 changes
Breaking changes 4
Business day strings must use zero-padded YYYY-MM-DD format in all builds; other formats throw, so use that format or a BusinessDay object.
The pane separator colour is applied as background-color rather than the background shorthand, so only colour values are accepted.
Curved lines use Fritsch-Carlson monotone interpolation instead of Catmull-Rom, avoiding overshoot; curves may look different.
Markers larger than size 1 are no longer re-clamped to 30px in the renderer, so shapes scale with size and arrow tips remain aligned with the anchor price.
New APIs and options 12
Adds a per-price-line hit tolerance in pixels; the default remains 7, matching previous behavior.
Adds a chart option to choose which visible price scale is preferred by default when both left and right scales are available; defaults to right.
Adds hovered-series and associated object metadata to mouse event payloads.
Adds an option, defaulting to true, that renders the currently hovered series above other series in the same pane.
Custom series can opt in to hit testing with an optional hook; a geometry-based fallback is used when it is not provided.
Adds control over price-scale tick mark label density; higher values mean more spacing and fewer tick marks, and lower values mean less spacing and more tick marks. Defaults to 2.5.
Adjusts the zoom level threshold for conflation activation and can create smoothing effects.
When enabled, the crosshair snaps to the nearest visible series data point instead of snapping to hidden series indices.
Plugin developers can implement custom aggregation logic through this interface.
Enables or disables data conflation; it is disabled by default.
Pre-calculates conflated data on initialization to improve zoom performance, at the cost of initial load time and memory usage; defaults to false.
Controls background computation priority when using the Prioritized Task Scheduling API; defaults to 'background'.
Performance 3
Whitespace generated by a yield curve chart's minimumTimeRange is capped at 100,000 points to prevent very large values from freezing the page while allocating memory.
Improves performance on charts combining series markers with large datasets by avoiding cloning the entire series dataset on every mouse move.
When enabled, conflation merges data points when zoomed out to improve rendering performance for large datasets.
Behavior and default changes 2
Requesting options for an overlay price scale without series now returns the options it will be created with, based on the chart's overlayPriceScales option.
When enabled, hovering an Area or Baseline series renders its stroke, point markers, and price lines on a top layer while the fill stays at its natural z-order.
Tooling 2
Adds an Agent Skill that teaches AI coding assistants Lightweight Charts v5 API conventions, mental models, and common foot-guns.
Each push to master publishes a compact preview package, making unreleased changes easier to test.
Fixes and other changes 23
Custom localization formatters are now removed when set back to undefined via applyOptions.
Area and Baseline series no longer throw on redraw for unparseable fill colours; such colours are drawn as transparent.
createChart no longer throws when its options object has its own hasOwnProperty key.
Prices are rounded rather than truncated when minMove is 1 or greater.
Series with equal visible values around 1e15 and above are drawn instead of having an empty range.
Avoids a crash in environments where navigator.userAgentData.brands is undefined, including some WebView and privacy-restricted browsers.
Pane, separator, and time-axis sizing no longer exceeds chart height at fractional device pixel ratios, preventing a one-pixel time-axis shift when panes change.
The precision option is now honored for the percent price format, including precision 0.
The option now uses scheduler.postTask in production, so precomputeConflationPriority has an effect.
Animated scrolling now reaches its target, including when the first animation frame arrives after the duration; kinetic scrolling no longer skips its final frame.
Historical updates at times without a bar insert the new bar there instead of overwriting the next bar; whitespace updates no longer remove the next bar.
Calling setData with identical times and then adding another series no longer makes the chart empty or causes getVisibleLogicalRange to return null.
Setting a visible range no longer collapses the requested range when zoomed in below the minimum visible bars count.
Adding new bars while the user drags the chart no longer makes the time scale jump.
Default tick mark labels during the hour skipped when daylight saving time starts no longer display an hour late or disagree with crosshair labels.
Resets the provider when explicitly set back to undefined via applyOptions, restoring autoscaling after a custom provider was used.
Prevents a Value is null error when replacing multiple series with shorter datasets while the crosshair hovers over data by invalidating affected pane views before time scale changes.
Fixes visual jitter when auto-sized charts are resized within dynamic containers; ResizeObserver-triggered resize behavior now paints synchronously.
Dash phase remains continuous when a series changes stroke color per data item, preventing dash patterns from restarting at color boundaries.
Fixes point markers not being drawn correctly when per-point colors change.
Fixes a visual bug where a pane's DOM element could remain on screen after removing its last series when that series contained large values.
The time scale method now respects the rightOffset option when rightOffsetPixels is not set.
Price axis label positioning no longer treats plugin views without this optional method as positioned at coordinate 0, avoiding false overlap detection.