Releases: tradingview/lightweight-charts
v5.0.1
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
andImageWatermark
) - 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 toISeriesApi
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:
- Series Creation API changes
- Watermarks and Series Markers moving to separate plugins
- 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
v4.2.3
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)
v4.2.2
Minor Improvements
- Improved price scale width calculation by not allocating space for crosshair labels when the crosshair is disabled. (PR #1743)
Bug Fixes
v4.2.1
Bug Fixes
- Fixed an issue where the series title part of a price scale label appeared blurry when using Firefox.
v4.2.0
Enhancements
- Added new
attributionLogo
option toLayoutOptions
. This feature displays the TradingView attribution logo on the main chart pane by default, helping users meet the library's licensing requirements for attribution.- The TradingView attribution logo can be easily hidden by setting the
attributionLogo
option tofalse
in the chart'slayout
option.
- The TradingView attribution logo can be easily hidden by setting the
- Improved data validation for
OhlcData
andSingleValueData
. IntroducedisFulfilledBarData
forOhlcData
andisFulfilledLineData
forSingleValueData
, ensuring more accurate validation of data types. Contributed by @mozeryansky (PR #1579, fixes #1526).
v4.1.7
Enhancements
- Further Refinement of the Price Scale Label Alignment. (PR #1630)
v4.1.6
v4.1.5
Enhancements
- Added
IHorzScaleBehavior.shouldResetTickmarkLabels
. (PR #1614)
4.1.4
Bug Fixes
- Fixed hoveredSeries being undefined during series removal and creation. (PR #1529, fixes #1406, fixes #1499)
- Fixed price label rendering artefact. (PR #1585, fixes #1584)
- Fixed an issue that prevented primitives with
zOrder
set totop
from drawing above the last price animation. (PR #1576) - Fixed possible ReDos. (PR #1536)
- Fixed marker positioning, which could cause a space between histogram and bottom of the chart. (PR #1538 & #1539, fixes #1382)