obv 그래프 추가수정
This commit is contained in:
@@ -897,8 +897,11 @@ export class ChartManager {
|
|||||||
const fallbackColor = config.type === 'OBV' && plotDef.id === 'plot0'
|
const fallbackColor = config.type === 'OBV' && plotDef.id === 'plot0'
|
||||||
? (regPlot?.color ?? '#2196F3')
|
? (regPlot?.color ?? '#2196F3')
|
||||||
: (regPlot?.color ?? plotDef.color ?? '#2962FF');
|
: (regPlot?.color ?? plotDef.color ?? '#2962FF');
|
||||||
|
const resolvedColor = config.type === 'OBV' && plotDef.id === 'plot0'
|
||||||
|
? '#FFFF00'
|
||||||
|
: resolvePlotLineColor(plotDef.color, fallbackColor);
|
||||||
series = this.chart.addSeries(LineSeries, {
|
series = this.chart.addSeries(LineSeries, {
|
||||||
color: resolvePlotLineColor(plotDef.color, fallbackColor),
|
color: resolvedColor,
|
||||||
lineWidth: (config.type === 'OBV' && plotDef.id === 'plot0'
|
lineWidth: (config.type === 'OBV' && plotDef.id === 'plot0'
|
||||||
? Math.max(2, plotDef.lineWidth ?? regPlot?.lineWidth ?? 2)
|
? Math.max(2, plotDef.lineWidth ?? regPlot?.lineWidth ?? 2)
|
||||||
: Math.max(1, plotDef.lineWidth ?? 1)) as 1 | 2 | 3 | 4,
|
: Math.max(1, plotDef.lineWidth ?? 1)) as 1 | 2 | 3 | 4,
|
||||||
@@ -910,6 +913,19 @@ export class ChartManager {
|
|||||||
...(indicatorPriceFormat ? { priceFormat: indicatorPriceFormat } : {}),
|
...(indicatorPriceFormat ? { priceFormat: indicatorPriceFormat } : {}),
|
||||||
}, pane);
|
}, pane);
|
||||||
series.setData(filtered.map(p => ({ time: p.time as Time, value: p.value })));
|
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 });
|
seriesMeta.push({ plotId: plotDef.id, isHistogram: false, color: plotDef.color });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2887,7 +2903,12 @@ export class ChartManager {
|
|||||||
const fallbackColor = entry.type === 'OBV' && pid === 'plot0'
|
const fallbackColor = entry.type === 'OBV' && pid === 'plot0'
|
||||||
? (regPlot?.color ?? '#2196F3')
|
? (regPlot?.color ?? '#2196F3')
|
||||||
: (regPlot?.color ?? plot.color ?? '#aaa');
|
: (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'
|
opts['lineWidth'] = entry.type === 'OBV' && pid === 'plot0'
|
||||||
? Math.max(2, plot.lineWidth ?? regPlot?.lineWidth ?? 2)
|
? Math.max(2, plot.lineWidth ?? regPlot?.lineWidth ?? 2)
|
||||||
: Math.max(1, plot.lineWidth ?? regPlot?.lineWidth ?? 1);
|
: Math.max(1, plot.lineWidth ?? regPlot?.lineWidth ?? 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user