Improve candleChart behavior

This commit is contained in:
Matthias 2022-10-31 20:41:34 +01:00
parent 6230abedab
commit 94d0fd5bb5

View File

@ -489,13 +489,17 @@ export default defineComponent({
chartOptions.value.series.push(tradesSeries); chartOptions.value.series.push(tradesSeries);
} }
console.log('chartOptions', chartOptions.value); // console.log('chartOptions', chartOptions.value);
if (candleChart.value) { candleChart.value?.setOption(chartOptions.value, {
candleChart.value.setOption(chartOptions.value); replaceMerge: ['series', 'grid', 'yAxis', 'xAxis', 'legend'],
} noMerge: !initial,
});
}; };
const initializeChartOptions = () => { const initializeChartOptions = () => {
// Ensure we start empty.
candleChart.value?.setOption({}, { noMerge: true });
chartOptions.value = { chartOptions.value = {
title: [ title: [
{ {
@ -706,7 +710,6 @@ export default defineComponent({
candleChart, candleChart,
buyData, buyData,
sellData, sellData,
chartOptions,
strategy, strategy,
pair, pair,
timeframe, timeframe,