백테스팅 보조지표 차트명 안나오는 문제 수정

This commit is contained in:
Macbook
2026-06-06 03:15:07 +09:00
parent 650fb354a8
commit 4c057a3e07
+17 -2
View File
@@ -2354,13 +2354,20 @@ export class ChartManager {
*/ */
getIndicatorPaneScreenLayout(id: string): { topY: number; height: number } | null { getIndicatorPaneScreenLayout(id: string): { topY: number; height: number } | null {
const entry = this.indicators.get(id); const entry = this.indicators.get(id);
if (!entry || entry.paneIndex == null || entry.paneIndex < 2) return null; if (!entry || entry.paneIndex == null) return null;
/* pane 0 = 메인 캔들차트 → 제외.
* volumeVisible=false 시 볼륨 패인(1)이 없어 RSI 가 LWC pane 1 에 배치되는 경우를
* _resyncIndicatorPaneIndices() 가 entry.paneIndex=1 로 갱신하므로,
* 기존 < 2 가드 대신 === 0 가드로 완화한다. */
if (entry.paneIndex === 0) return null;
const containerRect = this.container.getBoundingClientRect(); const containerRect = this.container.getBoundingClientRect();
const MIN_H = 4; const MIN_H = 4;
for (const series of entry.seriesList) { for (const series of entry.seriesList) {
try { try {
const el = series.getPane().getHTMLElement(); const pane = series.getPane();
if (pane.paneIndex() === 0) continue; // 메인 캔들 패인 제외
const el = pane.getHTMLElement();
if (!el) continue; if (!el) continue;
const rect = el.getBoundingClientRect(); const rect = el.getBoundingClientRect();
const height = Math.round(rect.height); const height = Math.round(rect.height);
@@ -2373,6 +2380,14 @@ export class ChartManager {
/* try next series */ /* try next series */
} }
} }
/* series.getPane().getHTMLElement() 이 null 반환 시 (compactPaneLayout 등)
* getPaneLayouts() 의 fallback 추정값으로 대체 */
const paneLayout = this.getPaneLayouts().find(l => l.paneIndex === entry.paneIndex);
if (paneLayout && paneLayout.height >= MIN_H) {
return { topY: paneLayout.topY, height: paneLayout.height };
}
return null; return null;
} }