diff --git a/frontend/src/utils/ChartManager.ts b/frontend/src/utils/ChartManager.ts index dc8fa00..0022566 100644 --- a/frontend/src/utils/ChartManager.ts +++ b/frontend/src/utils/ChartManager.ts @@ -897,8 +897,11 @@ export class ChartManager { const fallbackColor = config.type === 'OBV' && plotDef.id === 'plot0' ? (regPlot?.color ?? '#2196F3') : (regPlot?.color ?? plotDef.color ?? '#2962FF'); + const resolvedColor = config.type === 'OBV' && plotDef.id === 'plot0' + ? '#FFFF00' + : resolvePlotLineColor(plotDef.color, fallbackColor); series = this.chart.addSeries(LineSeries, { - color: resolvePlotLineColor(plotDef.color, fallbackColor), + color: resolvedColor, lineWidth: (config.type === 'OBV' && plotDef.id === 'plot0' ? Math.max(2, plotDef.lineWidth ?? regPlot?.lineWidth ?? 2) : Math.max(1, plotDef.lineWidth ?? 1)) as 1 | 2 | 3 | 4, @@ -910,6 +913,19 @@ export class ChartManager { ...(indicatorPriceFormat ? { priceFormat: indicatorPriceFormat } : {}), }, pane); series.setData(filtered.map(p => ({ time: p.time as Time, value: p.value }))); + if (config.type === 'OBV') { + const p0 = result.plots['plot0'] as PlotData | undefined; + const p1 = result.plots['plot1'] as PlotData | undefined; + console.error( + `[OBV addIndicator] plotDef.id=${plotDef.id}`, + '| visible:', isPlotVisible, + '| filteredLen:', filtered.length, + '| first val:', filtered[0]?.value, + '| last val:', filtered[filtered.length - 1]?.value, + '| p0.length:', p0?.length, '| p1.length:', p1?.length, + '| pane:', pane, + ); + } seriesMeta.push({ plotId: plotDef.id, isHistogram: false, color: plotDef.color }); } @@ -2887,7 +2903,12 @@ export class ChartManager { const fallbackColor = entry.type === 'OBV' && pid === 'plot0' ? (regPlot?.color ?? '#2196F3') : (regPlot?.color ?? plot.color ?? '#aaa'); - opts['color'] = resolvePlotLineColor(plot.color, fallbackColor); + opts['color'] = (entry.type === 'OBV' && pid === 'plot0') + ? '#FFFF00' + : resolvePlotLineColor(plot.color, fallbackColor); + if (entry.type === 'OBV') { + console.error(`[OBV applyStyle] pid=${pid} visible=${visible} color=${opts['color']}`); + } opts['lineWidth'] = entry.type === 'OBV' && pid === 'plot0' ? Math.max(2, plot.lineWidth ?? regPlot?.lineWidth ?? 2) : Math.max(1, plot.lineWidth ?? regPlot?.lineWidth ?? 1);