From 654a7eef3b9b49b88d22ff30095d98a4eda0263b Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 21 Dec 2020 20:46:22 +0100 Subject: [PATCH] Support plot-config changes again --- src/components/charts/CandleChart.vue | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/components/charts/CandleChart.vue b/src/components/charts/CandleChart.vue index 5010e677..d251f27b 100644 --- a/src/components/charts/CandleChart.vue +++ b/src/components/charts/CandleChart.vue @@ -45,26 +45,22 @@ export default class CandleChart extends Vue { @Prop({ required: true }) plotConfig!: PlotConfig; - // Only recalculate buy / sell data if necessary - signalsCalculated = false; - buyData = [] as Array[]; sellData = [] as Array[]; chartOptions: echarts.EChartOption = {}; - @Watch('timeframe') - timeframeChanged() { - this.signalsCalculated = false; - } - @Watch('dataset') datasetChanged() { - this.signalsCalculated = false; this.updateChart(); } + @Watch('plotConfig') + plotConfigChanged() { + this.initializeChartOptions(); + } + get strategy() { return this.dataset ? this.dataset.strategy : ''; } @@ -107,6 +103,7 @@ export default class CandleChart extends Vue { useUTC: this.useUTC, animation: false, legend: { + // Initial legend, further entries are pushed to the below list data: ['Candles', 'Volume', 'Buy', 'Sell'], right: '1%', },