Streamlit Lightweight Charts Pro
Professional-grade financial charting library for Streamlit applications
Streamlit Lightweight Charts Pro is a comprehensive Streamlit wrapper that brings TradingView's powerful lightweight-charts library to Streamlit with an intuitive, fluent API. Built on top of lightweight-charts-pro, it provides seamless integration with Streamlit's component system.
📚 Documentation
This project has comprehensive, multi-layered documentation:
- 📖 Official Documentation - Complete API reference, tutorials, and guides
- 📝 GitHub Wiki - Quick-start guides, FAQ, code recipes, troubleshooting
- 🔧 Setup Guides - Documentation infrastructure and setup
- 📁 Examples - Comprehensive code examples and tutorials
- 🔄 Migration Guide - Upgrading from previous versions
Quick Links
- Installation Guide
- Quick Start Tutorial
- Code Recipes - 50+ copy-paste examples
- FAQ
- Troubleshooting
✨ Features
🎯 Core Capabilities
- Interactive Financial Charts: Candlestick, line, area, bar, histogram, and baseline charts
- Fluent API: Method chaining for intuitive chart creation
- Multi-Pane Charts: Synchronized charts with multiple series and timeframes
- Trade Visualization: Built-in support for displaying trades with markers and annotations
- Advanced Annotations: Text, arrows, and shape annotations with layering
- Responsive Design: Auto-sizing charts that adapt to container dimensions
- Pandas Integration: Seamless DataFrame to chart data conversion
🚀 Advanced Features
- Price-Volume Charts: Pre-built candlestick + volume combinations
- Range Switchers: Professional time range selection (1D, 1W, 1M, 3M, 6M, 1Y, ALL)
- Auto-Sizing: Responsive charts with min/max constraints
- Custom Styling: Full control over colors, fonts, and visual elements
- Performance Optimized: Handles large datasets efficiently
- Type Safety: Comprehensive type hints and validation
🔧 Developer Experience
- Production Ready: Comprehensive logging, error handling, and security
- Well Documented: Complete API documentation with examples
- Tested: 450+ unit tests with 95%+ coverage
- Code Quality: Black formatting, type hints, and linting compliance
📦 Installation
pip install streamlit-lightweight-charts-pro
This will automatically install the required dependency: lightweight-charts-pro
🚀 Quick Start
import streamlit as st
from streamlit_lightweight_charts_pro import renderChart
import pandas as pd
st.title("Simple Line Chart")
# Create sample data
data = pd.DataFrame({
'time': pd.date_range('2024-01-01', periods=100, freq='D'),
'value': pd.Series(range(100)) + pd.Series(range(100)).apply(lambda x: x**0.5)
})
# Render chart
renderChart([
{
'type': 'line',
'data': data,
'options': {}
}
], {
'layout': {
'textColor': 'black',
'background': {
'type': 'solid',
'color': 'white'
}
}
})
🏗️ Architecture
This package is a Streamlit-specific wrapper that:
- Extends
BaseChartandBaseChartManagerfromlightweight-charts-pro - Provides Streamlit component integration via custom React component
- Manages session state and component lifecycle
- Renders charts using Streamlit's bi-directional component system
The package consists of:
- Python wrapper: Streamlit integration and session state management
- React frontend: Custom TypeScript/React component built on TradingView's lightweight-charts
- Core dependency:
lightweight-charts-proprovides chart classes and utilities
📖 Examples
Check out the examples/ directory for comprehensive examples:
- Getting Started: Basic chart types and configuration
- Advanced Features: Multi-pane charts, annotations, legends
- Trading Features: Trade visualization, signals, markers
- Custom Styling: Themes, colors, and visual customization
🔄 Migration from v0.2.x to v0.3.x
Version 0.3.0 renames the core dependency from lightweight-charts-core to lightweight-charts-pro. See MIGRATION.md for details on updating your code.
📄 License
MIT
🤝 Contributing
Contributions are welcome! Please check the main repository for contribution guidelines.
Release files for streamlit-lightweight-charts-pro 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| streamlit_lightweight_charts_pro-0.3.0.tar.gz | 275.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| streamlit_lightweight_charts_pro-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 545.0 kB
Release files / streamlit_lightweight_charts_pro-0.3.0.tar.gz
| Download URL | streamlit_lightweight_charts_pro-0.3.0.tar.gz |
|---|---|
| Size | 275.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc29bca53fb39bd68d333c8bf204e401fb0afb29f5be2f2f42a8935daceb365a
|
|
BLAKE2b-256 checksum How to use checksums |
e47fae89b936ade32b8cad0c48233a4645285c76449f14675369a4404bda7bf4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / streamlit_lightweight_charts_pro-0.3.0-py3-none-any.whl
| Download URL | streamlit_lightweight_charts_pro-0.3.0-py3-none-any.whl |
|---|---|
| Size | 269.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a3a9280836b1b42afaf04f2d4a9fd3b2fe292c4c96aeb19e165a647c2eeac56
|
|
BLAKE2b-256 checksum How to use checksums |
14255a7a67453454df2b9e912041bbde51adc5bde8af9276c710ea554a9e6bd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|