fix-attempt for damage chart not loading initially

This commit is contained in:
cnachtigall1991
2021-10-17 01:56:49 +02:00
parent 0fb2371c60
commit 6ffd7685ab
3 changed files with 28 additions and 26 deletions

View File

@@ -18,7 +18,7 @@ import {GridComponent, TooltipComponent, VisualMapComponent} from 'echarts/compo
import {HeatmapChart} from 'echarts/charts';
import {CanvasRenderer} from 'echarts/renderers';
import {onMounted} from "vue";
import {getPlayerArr, checkStatEmpty} from "../utils";
import {checkStatEmpty, getPlayerArr} from "../utils";
import {useStore} from "vuex";
export default {
@@ -119,20 +119,24 @@ export default {
}
}
onMounted(() => {
echarts.use([
TooltipComponent,
GridComponent,
VisualMapComponent,
HeatmapChart,
CanvasRenderer
]);
let myChart1, myChart2
let myChart1 = echarts.init(document.getElementById('multi-kills-chart-1'), {}, {width: 500, height: 500});
let myChart2 = echarts.init(document.getElementById('multi-kills-chart-2'), {}, {width: 500, height: 500});
onMounted(() => {
if (store.state.matchDetails.stats) {
echarts.use([
TooltipComponent,
GridComponent,
VisualMapComponent,
HeatmapChart,
CanvasRenderer
]);
myChart1 = echarts.init(document.getElementById('multi-kills-chart-1'), {}, {width: 500, height: 500});
myChart2 = echarts.init(document.getElementById('multi-kills-chart-2'), {}, {width: 500, height: 500});
myChart1.setOption(optionGen(1));
myChart2.setOption(optionGen(2));
}
})
}
}