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));