Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V5] The pane supports collapse and restore. #1802

Open
1123612483 opened this issue Feb 6, 2025 · 1 comment
Open

[V5] The pane supports collapse and restore. #1802

1123612483 opened this issue Feb 6, 2025 · 1 comment

Comments

@1123612483
Copy link

1123612483 commented Feb 6, 2025

Is your feature request related to a problem? Please describe.

Here is a use case: when all the series of a particular pane are hidden, the pane should be collapsed; otherwise, the pane should be restored.

const secondPane = chart.pane()[1];
const series = secondPane.getSeries();
const visible = series.some(s => s.option().visible);

secondPane.setHeight(visible ? 200 : 0); // It doesn't work when visible is set to false because the minimum height of the pane is 30px.

Describe the solution you'd like
Based on this use case, the IPaneApi needs to add two methods: collapse() and restore().

const secondPane = chart.pane()[1];
const series = secondPane.getSeries();
const visible = series.some(s => s.option().visible);

if (visible) {
   secondPane.restore();
}else {
   secondPane.collapse();
}

Additional context

@vishnuc
Copy link

vishnuc commented Feb 6, 2025

+1 . Yea same , need more apis to pane , its very limited now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants