diff --git a/frontend/src/utils/ChartManager.ts b/frontend/src/utils/ChartManager.ts index ccca681..47486d5 100644 --- a/frontend/src/utils/ChartManager.ts +++ b/frontend/src/utils/ChartManager.ts @@ -2437,6 +2437,16 @@ export class ChartManager { const plotById = Object.fromEntries(plotDefs.map((p: PlotDef) => [p.id, p])); + // 일목균형표: 구름 플러그인이 붙은 호스트 시리즈(plot3 우선, 없으면 seriesList[0]) 식별 + // LWC는 visible:false 시리즈에 붙은 primitive를 렌더링하지 않으므로 + // 호스트 시리즈는 항상 visible:true 로 유지하고, 사용자가 라인을 숨길 경우 + // 투명 색상으로 처리한다. + const ichimokuCloudHost: ISeriesApi | null = (() => { + if (entry.type !== 'IchimokuCloud' || !entry.cloudPlugin) return null; + const plot3Idx = entry.seriesMeta.findIndex(m => m.plotId === 'plot3'); + return plot3Idx >= 0 ? entry.seriesList[plot3Idx] : (entry.seriesList[0] ?? null); + })(); + entry.seriesList.forEach((series, i) => { let plot: PlotDef | undefined; const pid = entry.seriesMeta[i]?.plotId; @@ -2446,13 +2456,19 @@ export class ChartManager { const visible = indicatorVisible && config.plotVisibility?.[plot.id] !== false; const paneIdx = entry.paneIndex ?? 0; const indicatorPriceFormat = priceFormatForIndicatorPane(paneIdx); + const isCloudHost = series === ichimokuCloudHost; + // eslint-disable-next-line @typescript-eslint/no-explicit-any - const opts: Record = { visible }; + const opts: Record = { + // 구름 호스트 시리즈: 지표 전체가 hidden 일 때만 실제로 visible:false + visible: isCloudHost ? indicatorVisible : visible, + }; if (indicatorPriceFormat) { opts['priceFormat'] = indicatorPriceFormat; } if (!entry.seriesMeta[i]?.isHistogram) { - opts['color'] = plot.color ?? '#aaa'; + // 구름 호스트 시리즈가 사용자에 의해 숨겨진 경우 → 라인을 투명 처리 + opts['color'] = (isCloudHost && !visible) ? 'rgba(0,0,0,0)' : (plot.color ?? '#aaa'); if (plot.lineWidth != null) opts['lineWidth'] = plot.lineWidth; opts['lineStyle'] = plotSeriesLineStyle(plot.lineStyle); let plotAllows = true; @@ -2460,8 +2476,8 @@ export class ChartManager { plotAllows = entry.seriesMeta[i]?.plotId !== 'plot2'; } const showPriceLabel = this.shouldShowSeriesPriceLabel(config, plotAllows, paneIdx); - opts['lastValueVisible'] = showPriceLabel; - opts['title'] = paneIdx < 2 && showPriceLabel + opts['lastValueVisible'] = showPriceLabel && visible; + opts['title'] = paneIdx < 2 && showPriceLabel && visible ? this.seriesTitleForPlot(config, plot, plotAllows, paneIdx) : ''; } else {