May 6, 2020
Announcing Lightweight Charts 2.0

The team at TradingView is excited to release Lightweight Charts 2.0. We’ve added pixel perfect rendering, time scale improvements, API enhancements, and more. In this post, we’ll walk you through each of these updates.

Pixel perfect rendering

All Lightweight Charts will now appear in their highest resolution and render at industry leading speeds. You will no longer need to perform any manual smoothing and resolutions will be dynamic, including the following enhancements:

  • At any screen resolution or browser zoom (whether it’s 100% or 300%), charts won’t have smoothing and lines at the same coordinate will be at the same pixel;
  • When the zoom level changes in a browser, the chart will remain in its proper place without any refresh needed; and
  • All chart elements will adjust and automatically fit into the pixel grid.

The before and after images below show the impact of pixel perfect rendering:

Time scale improvements

We’ve made several improvements to how you can zoom in and out from a chart. You can now scroll or zoom until you see at least 2 bars on the chart. Here’s how it will look when zooming in to see at least two bars of trading:

API enhancements for handleScroll and handleScale options

Previously, in version 1.0, in order to enable or disable available scrolling and zooming options, you had to list all of the options one by one, which was slightly inconvenient. We set out to make that simpler.

In Lightweight Charts 2.0, you can set handleScroll and handleScale to true or false without listing each request. This quick fix will allow you to efficiently turn on/off all scrolling and zooming options.

New date formats

It’s important for traders and investors to see the dates and times on their charts at all times. In Lightweight Charts 2.0, we added 19 new date formats to display on the chart.

New option to display series’ last price line

In the previous version of Lightweight Charts, the price line of the series would always correspond with the value of the last bar of the series, even if it wasn’t visible. We wanted to fix this, and in Lightweight Charts 2.0, you’re now able to see the line for the last visible bar:

A special thanks to the community!

TradingView is a community of investors, traders, and even programmers. We want to say thank you to all of our contributors that helped with this release:

Andree Yosua;

kpaape;

Matt Conway.

We have more to show you

In this post, we’re only scratching the surface for what’s new in Lightweight Charts 2.0. To see a full list of changes, please check them out here in our Github notes. If you want to learn more about how Lightweight Charts can help you, please visit our Charting Library.

We hope you enjoyed this update. As always, please continue sending us your comments, suggestions, and feedback. It is our pleasure to build for you.

The fastest way to follow markets

Launch Chart