Skip to content

[Bug] Chart is not resizing when there is a sub indicator on the chart #718

@asfand987

Description

@asfand987

Version

Version: 10.0.0-alpha8

Steps to Reproduce

Reproduced code - https://stackblitz.com/edit/1yhdtq4q?file=index.js

This code is a simple multichart layout (2 charts side by side)

Pressing the button will open two new charts side by side with each chart resizing correctly.

Now uncomment the following line // chart1.createIndicator('RSI', true); // Sub-indicator to create a sub indicator and then press the button again to open a second chart. The first chart will not resize.

Current Behavior

Charts with sub-indicators fail to resize properly when their container dimensions change in KlineCharts alpha 8. The chart content retains its original width instead of adapting to the new container size. This issue i have noticed in alpha 8 after migrating to it from alpha 2.

The height is correctly resizing, but the width is not resizing correctly when a sub indicator is on the chart. I believe the issue might possibly be related to cacheYAxisWidth in Chart.ts but at the moment i have not been able to find a fix.

This issue did not exists on Alpha 2

Expected Behavior

With a sub indicator on the chart, calling resize should correctly resize the chart.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions