Skip to main content

📊 dash-tvlwc

Financial charts for Dash, written in Python.

A Dash component that wraps TradingView Lightweight Charts, so you can build candlestick, line, area and volume charts without writing any JavaScript.

Live demo · Documentation · PyPI


Why this and not a general plotting library

Lightweight Charts is built for one job: price series that stay smooth while you pan, zoom and stream into them. It handles very large series at 60fps, which general-purpose plotting libraries are not designed for.

This package makes it an ordinary Dash component. You describe the chart with Python dictionaries, and you read and drive it with ordinary Dash callbacks.

Install

pip install dash_tvlwc

Your first chart

import dash
from dash import html
import dash_tvlwc

candles = [
    {'time': '2026-01-01', 'open': 100, 'high': 101.3, 'low': 95.1, 'close': 97.6},
    {'time': '2026-01-02', 'open': 97.6, 'high': 99.1, 'low': 95.2, 'close': 96.1},
    {'time': '2026-01-03', 'open': 96.1, 'high': 98.4, 'low': 90.7, 'close': 92.1},
]

app = dash.Dash(__name__)
app.layout = html.Div([
    dash_tvlwc.Tvlwc(
        series=[{'id': 'price', 'type': 'candlestick', 'data': candles}],
        width='100%',
        height=400,
    ),
])

if __name__ == '__main__':
    app.run()

Each series is one dictionary carrying its own id, type and data. Put several in the list to draw several series on one chart.

What you can do

Each of these is an ordinary prop, set or read from a callback.

Six series types candlestick, bar, line, area, baseline, histogram
Sub-plots stack panes that share one time axis, for price over volume over an indicator
Live streaming append or revise a single bar without resending the whole series
Mouse events crosshair, click and double-click, reported with the time and price under the cursor
Drive the view set the visible range, scroll, fit to content, or place the crosshair from Python
Sync two charts point them at each other so hovering one moves the other
Infinite history be told when the user scrolls past the start of the data, and send more
Markers and price lines anchored to a bar or to a price
Read data back ask a series for one bar, or for its last value, without shipping the dataset
Screenshots capture the canvas as a PNG
Three chart types a time axis (Tvlwc), a price axis (Tvlwo), a maturity axis (Tvlwy)

What it cannot do

This is a bridge between Python and a JavaScript charting library, and some things do not survive the crossing:

  • Anything that has to be a function - custom scaling logic, colour parsers, axis formatters written in Python. Formatters are still possible, but you write them in a small JavaScript file and refer to them by name.
  • Plugins, custom series types and drawing tools. These are JavaScript classes in the underlying library, and a class cannot be expressed as a Dash prop.
  • Anything that must react within a single frame, such as dragging a trendline. Every interaction routed through a Python callback costs a network round trip.
  • Reading a whole dataset back out of the chart. You can ask for one point at a time; you cannot ask for all of them.

The documentation has a page on each of these and what to do instead.

Documentation

  • Documentation site - how to express a chart in Python, with worked examples.
  • Lightweight Charts v5 API - the full list of chart and series options. Whatever the library accepts, this component passes through.
  • demo/app.py - source of the live demo; every panel shows the settings behind it.
  • examples/ - runnable apps for styling, callbacks and each capability.

Compatibility

Python 3.9 or newer
Dash 3.0 or newer, tested to 4.4
Lightweight Charts 5.2.1, bundled

Version 0.2.0 changes the prop schema. Upgrading from 0.1.x is covered by the migration guide.

Contributing

Bug reports and pull requests are welcome. See CONTRIBUTING.md, and DEVELOPMENT.md for building the component from source.

License

MIT. Charts by TradingView, used under the Apache 2.0 license of Lightweight Charts.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dash_tvlwc-0.2.1.tar.gz (280.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dash_tvlwc-0.2.1-py3-none-any.whl (294.1 kB view details)

Uploaded Python 3

File details

Details for the file dash_tvlwc-0.2.1.tar.gz.

File metadata

  • Download URL: dash_tvlwc-0.2.1.tar.gz
  • Upload date:
  • Size: 280.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for dash_tvlwc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 458b53ff1493a6534e14db922b2ae14282826a3fb39ef64a75977f6770cb9c72
MD5 7038c127c5399b3994db3ca35b1bcd38
BLAKE2b-256 10c8ac034401caf353903b861a19dcc0feef56b504ef37946657ce0d1f94ac42

See more details on using hashes here.

File details

Details for the file dash_tvlwc-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: dash_tvlwc-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 294.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for dash_tvlwc-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f2947ec38345ffed0e3e53844dd3af3619796d2064cf7d9cfb78b923a1fbeb0
MD5 14476aed60a5229fae44bfc86060bca0
BLAKE2b-256 866cb90b265c5701e10a30be9ce41257280d7e2f0c0931ab0a51854765a2c200

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page