Skip to main content

Examples

Live charts with the code that draws them, using only the Lightweight Charts™ library. Copy the code into your project, or copy a complete HTML page that runs on its own.

Candlestick

Price movement drawn as candlesticks colored by direction.

Series types

Bar

Price movement drawn as OHLC bars colored by direction.

Series types

Line

A single value per point joined by a line.

Series types

Area

A line with the area below it filled with a gradient.

Series types

Baseline

Values above and below a base price drawn in different colors.

Series types

Histogram

Vertical columns, often used for volume.

Series types

Compare multiple series

Several line series on one chart, sharing one price scale.

Series types

Yield curve with updates

Two yield curves updating live, with markers that show each change.

Chart types

Custom horizontal scale

A line chart with prices instead of dates on the horizontal scale.

Chart types

Options chart

The profit of an options position at expiry, plotted against the price.

Chart types

Two price scales

Two series, each with its own price scale on the left and on the right.

Price scales

Inverted price scale

A price scale flipped so that higher values are at the bottom.

Price scales

Price and volume

Volume bars drawn under the price on the same chart.

Price scales

Price scale modes

Two assets compared on a normal, logarithmic, percentage, or indexed price scale.

Price scales

Custom price format

Large values shown as short dollar amounts, such as $1.25B, on the price scale.

Price scales

Time zones

One trading session shown in UTC, New York, Berlin, or Tokyo time.

Time scale

Visible range

Buttons that show the last week, month, quarter, or year of the same data.

Time scale

Custom date format

Your own date and time labels on the time scale and the crosshair.

Time scale

Whitespace data

Gaps in a series for periods that have no data.

Data

Realtime updates

A candlestick chart that receives new prices in real time.

Data

Infinite history

A candlestick chart that loads older data as you scroll back in time.

Data

Range switcher

Buttons that switch the chart between daily, weekly, monthly, and yearly data.

Data

Screenshot

A button that saves the chart as a PNG image.

Data

Panes

An area series and candlesticks in two separate panes.

Panes

Series markers

Buy, sell, and other markers placed on candlesticks.

Markers and lines

Price lines

Horizontal lines at the minimum, average, and maximum price.

Markers and lines

Click to add markers

Markers that appear on the bar you click and disappear on a second click.

Markers and lines

Floating tooltip

A tooltip that positions itself next to the data point under the cursor.

Tooltips and legends

Tracking tooltip

A tooltip that follows the cursor.

Tooltips and legends

Magnifier tooltip

A tooltip at the top edge of the chart that follows the cursor along the time scale.

Tooltips and legends

Legend

A legend that shows the symbol name and the price under the cursor.

Tooltips and legends

Three-line legend

A legend that shows the symbol, the price, and the date under the cursor on three lines.

Tooltips and legends

Sync two charts

Two charts whose crosshairs and visible ranges move together.

Crosshair

Tracking on mobile

Crosshair tracking on touch devices without a long press.

Crosshair

Crosshair modes

A crosshair that moves freely, snaps to prices, or is hidden, switched with buttons.

Crosshair

Custom font

Chart text in a custom font, switched with buttons.

Styling

Custom locale

Dates formatted for different locales, switched with buttons.

Styling

Text watermark

A text watermark drawn behind the series.

Styling

Image watermark

An image watermark drawn behind the series.

Styling

Hidden time scale

A line chart without the time axis at the bottom.

Styling