fixed: remember RSI pane height across data updates
This commit is contained in:
@ -649,7 +649,8 @@ function addIndicator(type) {
|
||||
params,
|
||||
plots: metadata.plots,
|
||||
series: [],
|
||||
visible: true
|
||||
visible: true,
|
||||
paneHeight: Math.floor(window.innerHeight * 0.2) // default 20% of screen
|
||||
});
|
||||
|
||||
// Don't set configuringId so indicators are NOT expanded by default
|
||||
@ -920,10 +921,9 @@ export function drawIndicatorsOnChart() {
|
||||
}
|
||||
});
|
||||
|
||||
// Calculate heights based on VISIBLE indicators only
|
||||
// Set main pane height (60% if indicator panes exist, 100% otherwise)
|
||||
const totalPanes = 1 + paneIndicators.length;
|
||||
const mainPaneHeight = paneIndicators.length > 0 ? 60 : 100;
|
||||
const paneHeight = paneIndicators.length > 0 ? Math.floor(40 / paneIndicators.length) : 0;
|
||||
|
||||
window.dashboard.chart.panes()[0]?.setHeight(mainPaneHeight);
|
||||
|
||||
@ -948,7 +948,10 @@ export function drawIndicatorsOnChart() {
|
||||
|
||||
const pane = window.dashboard.chart.panes()[paneIndex];
|
||||
if (pane) {
|
||||
pane.setHeight(paneHeight);
|
||||
// Use stored height or default to 20% of chart height
|
||||
const defaultHeight = Math.floor(window.innerHeight * 0.2);
|
||||
const storedHeight = indicator.paneHeight || defaultHeight;
|
||||
pane.setHeight(storedHeight);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user