louisnw01 / lightweight-charts-python

Python framework for TradingView's Lightweight Charts JavaScript library.
MIT License
1.14k stars 213 forks source link

[BUG] Subcharts with JupyterChart is wrong layout #410

Open DonYum opened 4 months ago

DonYum commented 4 months ago

Expected Behavior

image

Current Behaviour

image

Reproducible Example

import pandas as pd
from lightweight_charts import JupyterChart

if __name__ == '__main__':
    chart = JupyterChart(inner_width=0.5, inner_height=0.5)
    chart2 = chart.create_subchart(position='right', width=0.5, height=0.5)
    chart3 = chart.create_subchart(position='left', width=0.5, height=0.5)
    chart4 = chart.create_subchart(position='right', width=0.5, height=0.5)

    chart.watermark('1')
    chart2.watermark('2')
    chart3.watermark('3')
    chart4.watermark('4')

    df = pd.read_csv('ohlcv.csv')
    chart.set(df)
    chart2.set(df)
    chart3.set(df)
    chart4.set(df)

    chart.load()

Environment

- OS: macOS 13.2
- Library: lightweight-charts==2.0.1
DonYum commented 4 months ago

Is there any progress?

marcelogrcia commented 4 months ago

In fact, any subchart is plotting in JupyterChart right now..

CoderTom314 commented 3 months ago

i failed to plot any subchart with jupyterchart as of today