Skip to content

Releases: tradingview/lightweight-charts

v5.0.9

01 Oct 12:02
fdef142

Choose a tag to compare

Enhancements

  • Added rightOffsetPixels option to HorzScaleOptions, allowing margin space from the right side of the chart to be set in pixels. This option takes precedence over rightOffset and ensures consistent pixel offset when using fitContent on charts with different amounts of data. The pixel-based offset remains consistent during zoom operations. (PR #1957)
  • Added pop method to series API that removes a specified number of data points from the end of the series and returns the removed data. (PR #1949, fixes #1518, contributed by @tpunt)
  • Enhanced takeScreenshot method with two new optional parameters:
    • addTopLayer - includes top layer primitives in the screenshot (default: false)
    • includeCrosshair - includes the crosshair when addTopLayer is enabled (default: false)
      (PR #1977)
  • Added autoScale option to SeriesMarkersOptions, allowing control over whether markers are included in the auto-scaling calculation of the price scale. When enabled (default: true), the chart will adjust its scale to ensure markers are fully visible. (PR #1940, contributed by @zbinlin)
  • Added base option to price format configuration as an alternative to minMove. This helps avoid floating-point precision limitations when dealing with extremely small price movements. (PR #1952)
  • Enhanced plugin API with additional functionality:
    • Added lastValueData() method to the public series API
    • Exposed setLineStyle drawing utility through a new DrawingUtils interface
      (PR #1956, contributed by @tpunt)

Bug Fixes

  • Fixed price scale visible range calculation when in logarithmic scale mode by properly converting the range from log space and handling precision issues with rounding. (PR #1965, contributed by @tpunt)

Plugin & Indicator Examples

  • Added Dual Range Histogram Series custom plugin example that visualizes paired positive and negative value ranges for each time point using a column-based display. (PR #1934)
  • Added Pretty Histogram plugin example demonstrating non-standard histogram rendering. (PR #1930)
  • Added examples demonstrating how to implement indicators (studies) within Lightweight Charts. See the Analysis Indicators tutorial for more information. (PR #1915)

Contributors

We'd like to thank our external contributors for their valuable contributions to this release:

Changes since the last published version.

v5.0.8

26 Jun 11:50
c65d069

Choose a tag to compare

Enhancements

  • Improved pane API with several new methods and options:
    • Added addDefaultPane option to chart options, allowing creation of charts with no initial panes
    • Added addPane method to IChartApi for programmatically adding panes
    • Added setPreserveEmptyPane and preserveEmptyPane methods to control empty pane behavior
    • Added getStretchFactor and setStretchFactor methods to control relative pane sizes
    • Added addCustomSeries and addSeries methods to IPaneApi for creating series directly on a specific pane
    • Updated getHTMLElement to return null when a pane hasn't been created yet
    • These improvements provide greater flexibility when working with multi-pane charts
      (PR #1894, fixes #1898, #1896, #1872, #1907)
  • Added additional price scale tick mark formatting capabilities:
    • Added formatTickmarks method to IPriceFormatter interface
    • Added tickmarksPriceFormatter and tickmarksPercentageFormatter options to LocalizationOptionsBase
    • Added tickmarksFormatter option to PriceFormatCustom
    • These new formatters provide all tick mark values at once, allowing for context-aware formatting decisions such as determining the optimal precision level needed
      (PR #1903)

Changes since the last published version.

v5.0.7

16 May 18:08
63ce2ad

Choose a tag to compare

Enhancements

  • Added price scale visible range control with new methods in IPriceScaleApi: setVisibleRange, getVisibleRange, and setAutoScale. These methods allow for programmatic control of the visible price range on a price scale. Also added ensureEdgeTickMarksVisible option to PriceScaleOptions, which ensures tick marks are always visible at the very top and bottom of the price scale, providing clear boundary indicators. These features are particularly useful for charts with zooming and panning disabled that are primarily for display purposes. (PR #1856)
  • Added control over the rendering stacking order of series markers through a new zOrder option in the series markers plugin. This enhancement provides greater flexibility in controlling marker visibility and layering in complex charts. (PR #1876).

Changes since the last published version.

v5.0.6

21 Apr 10:53
9c48779

Choose a tag to compare

Enhancements

  • Implemented series order functionality, allowing control over the rendering order of series within a pane. Series with higher order values are rendered on top of those with lower values. Added two new methods to ISeriesApi: seriesOrder() to get the current order index and setSeriesOrder(order) to set a specific order. (PR #1868)

Changes since the last published version.

v5.0.5

27 Mar 17:29
106ec90

Choose a tag to compare

Bug Fixes

  • Fixed an issue where the series marker plugin could throw an exception if the series data required for individual markers could not be found (such as when the data is cleared or changed via ⁠setData on the series). (PR #1845)

Changes since the last published version.

v5.0.4

24 Mar 16:12
5dbc653

Choose a tag to compare

Improvements

  • Fixed performance degradation when adding series markers to charts with large datasets (15,000+ data points) by optimizing marker calculations to only run when necessary. (PR #1835, fixes #1808)
  • Added price-based positioning for series markers, allowing more precise control over marker placement. New position types include atPriceTop, atPriceBottom, and atPriceMiddle, which require a price value to be specified. (PR #1826, thanks to @EranGrin)
  • Added MagnetOHLC to CrosshairMode. This mode sticks the crosshair's horizontal line to the price value of a single-value series or to the open / high / low / close price of OHLC-based series. (PR #1831, thanks to @Jonney)

Bug Fixes

  • Fixed an issue where the crosshair marker would be visible on the first data point when the chart is initially loaded, before any user interaction. This behavior has been reverted to match version 4, where the crosshair remains hidden until user interaction. (PR #1840)

Changes since the last published version.

v5.0.3

26 Feb 14:27
1157acb

Choose a tag to compare

Bug Fixes

  • Fixed an issue where changing the price scale for one pane would impact all panes in multi-pane setups. Added pane index parameter to the price scale API to ensure changes only affect the intended pane. (PR #1821, fixes #1817)
  • Fixed an issue where a cursorStyle defined in a primitive hit-test wouldn't be applied. Additionally improved cursor style handling to maintain the correct cursor when the mouse remains in the same position while price/time scales are adjusted. (PR #1823)

Changes since the last published version.

v5.0.2

10 Feb 18:37
92c2187

Choose a tag to compare

Bug Fixes

  • Fixed an issue where the crosshair marker would remain visible after the mouse pointer has left the chart. (PR #1807)

Changes since the last published version.

v5.0.1

30 Jan 17:16
981ef26

Choose a tag to compare

Version 5.0 represents a significant milestone in the evolution of Lightweight Charts™, delivering on our commitment to keep the library truly "lightweight". Despite adding numerous new features, improvements, and fixes, we've managed to reduce the bundle size by up to 16%, bringing the base bundle size down to just 35kB. This remarkable reduction was achieved through enhanced tree-shaking capabilities, modernized architecture, and careful optimization of core features.

This release introduces highly requested features like multi-pane support and new chart types. It also modernizes the codebase and improves its architecture to set a foundation for future enhancements without compromising on size.

Major Updates

Multi-Pane Support

One of our most requested features, multi-pane support is now available. It allows you to create complex chart layouts with multiple independent viewing areas. This enhancement enables sophisticated technical analysis setups and better visualization of related data series. Additional key benefits include:

  • Full support for multiple panes within a single chart
  • Independent scale and series management per pane
  • Flexible pane sizing and arrangement options

See Panes for more information.

New Chart Types

Yield Curve Charts

  • New specialized chart type for displaying yield curves
  • Custom horizontal scale behavior with linear spacing
  • Optimized whitespace handling

Options Charts

  • Price-based horizontal scale support
  • Specialized formatting and interaction handling
  • Ideal for options chain visualization

See Chart types for more information about the Yield Curve Chart and Options Chart types.

Enhanced Color Support

  • Expanded native support for sRGB-based colors (RGB, RGBA, hex, named colors, HSL)
  • Support for expanded color gamuts like Display P3
  • Ability to specify a custom color parser to add support for non-sRGB formats
  • Reduced bundle size through browser-native color parsing

Architectural Improvements

  • Watermark feature reimplemented as plugins (TextWatermark and ImageWatermark)
  • Series Markers extracted as a plugin for better tree-shaking
  • New Up/Down Markers Plugin for price change visualization
  • Introduction of Pane Primitives for plugin attachment

Breaking Changes

  • New unified series creation API (see migration guide)
  • Dropped CommonJS support and updated JS syntax version to ES2020
  • Watermark functionality moved to plugins
  • Series markers implementation changed to plugin system

Enhancements

  • Added relative gradient option for baseline and area series (relativeGradient)
  • New time scale option for maximum bar spacing (maxBarSpacing)
  • Added priceLines() method to ISeriesApi interface
  • Enhanced watermark capabilities with multi-line text support
  • Improved plugin system with Pane Primitives support
  • Better tree-shaking capabilities for smaller bundle sizes

Bug Fixes

  • Fixed primitive detachment update issues (#1594)
  • Various performance and rendering improvements

Migration Guide

We've prepared a comprehensive migration guide to help you upgrade from v4 to v5. Key areas to note:

  1. Series Creation API changes
  2. Watermarks and Series Markers moving to separate plugins
  3. Plugin system updates

See the full migration guide: Migrating from v4 to v5

Technical Notes

This release uses ES2020 syntax and no longer supports CommonJS. If you need to support older environments, you'll need to set up transpilation for the lightweight-charts package in your build system using tools like Babel.


As always, we thank you for your support and help in making Lightweight Charts™ the best product on the financial web. We look forward to seeing what you build with these new capabilities!

You can always send us your feedback via GitHub.
Happy trading!

Team TradingView

See changes since the last published version.

v4.2.3

23 Jan 18:56
51ba240

Choose a tag to compare

Minor Improvements

  • Improve check for crosshair label visibility on the price scale. This improves upon previous work (#1743 in v4.2.2) by reducing the allocated space for the crosshair when it is enabled, but the label is disabled. (PR #1757)

Bug Fixes

  • Added additional prototype pollution protection for internal merge helper function. (PR #1758)

Changes since the last published version.