fix live updates
This commit is contained in:
@@ -773,9 +773,14 @@ class ChartManager {
|
||||
const volumeColor = candle.close >= candle.open ? '#10b981' : '#ef4444';
|
||||
Plotly.extendTraces(plotId, {
|
||||
x: [[formattedTimestamp]],
|
||||
y: [[candle.volume]],
|
||||
marker: { color: [[volumeColor]] }
|
||||
y: [[candle.volume]]
|
||||
}, [1]).then(() => {
|
||||
// Update volume color separately using restyle
|
||||
const currentTrace = plotElement.data[1];
|
||||
if (currentTrace && currentTrace.marker && currentTrace.marker.color) {
|
||||
const newColors = [...currentTrace.marker.color, volumeColor];
|
||||
Plotly.restyle(plotId, {'marker.color': [newColors]}, [1]);
|
||||
}
|
||||
console.log(`[${timeframe}] Volume trace extended successfully`);
|
||||
}).catch(err => {
|
||||
console.error(`[${timeframe}] Error extending volume trace:`, err);
|
||||
@@ -4393,7 +4398,6 @@ class ChartManager {
|
||||
|
||||
this.liveMetricsOverlay = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Debug method to manually trigger pivot recalculation
|
||||
debugRecalculatePivots(timeframe) {
|
||||
@@ -4424,4 +4428,5 @@ class ChartManager {
|
||||
}
|
||||
});
|
||||
console.log('========================');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user