From 68146ce8b4899816f118533144e6862e1d47eeb7 Mon Sep 17 00:00:00 2001 From: cnachtigall1991 <40701475+cnachtigall1991@users.noreply.github.com> Date: Tue, 19 Oct 2021 21:29:24 +0200 Subject: [PATCH] fixed broken economy graph --- src/components/EqValueGraph.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/EqValueGraph.vue b/src/components/EqValueGraph.vue index eabb1aa..e2fb510 100644 --- a/src/components/EqValueGraph.vue +++ b/src/components/EqValueGraph.vue @@ -10,7 +10,7 @@ import {getPlayerValue} from "../utils"; import {useStore} from "vuex"; -import {onMounted, reactive, watch} from "vue"; +import {onBeforeMount, onMounted, reactive, watch} from "vue"; import * as echarts from 'echarts/core'; import { @@ -166,6 +166,10 @@ export default { let myChart1, max_rounds + onBeforeMount(() => { + max_rounds = store.state.matchDetails.max_rounds ? store.state.matchDetails.max_rounds : 30 + }) + onMounted(() => { data.team.push(getTeamPlayer(store.state.matchDetails.stats, 1)) data.team.push(getTeamPlayer(store.state.matchDetails.stats, 2)) @@ -195,7 +199,6 @@ export default { ]); myChart1 = echarts.init(document.getElementById('economy-graph'), {}, {width: 1200, height: 400}); - max_rounds = store.state.matchDetails.max_rounds ? store.state.matchDetails.max_rounds : 30 } myChart1.setOption(optionGen(dataList, valueList));