列车曲线图调整
This commit is contained in:
parent
dfbb1caca5
commit
74c045f890
@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue';
|
||||
import { watch } from 'vue';
|
||||
import { useLineStore } from 'src/stores/line-store';
|
||||
import DraggableDialog from 'src/components/common/DraggableDialog.vue';
|
||||
import * as echarts from 'echarts';
|
||||
@ -59,11 +59,11 @@ function getDataList() {
|
||||
});
|
||||
}
|
||||
|
||||
const myChart = ref();
|
||||
let myChart: echarts.EChartsType;
|
||||
function initEcharts() {
|
||||
const dom = document.getElementById('train-echarts');
|
||||
if (!dom) return;
|
||||
myChart.value = echarts.init(dom, null, {
|
||||
myChart = echarts.init(dom, null, {
|
||||
renderer: 'canvas',
|
||||
useDirtyRect: false,
|
||||
});
|
||||
@ -117,14 +117,14 @@ function initEcharts() {
|
||||
],
|
||||
};
|
||||
|
||||
myChart.value.setOption(option);
|
||||
myChart.setOption(option);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => lineStore.socketStates,
|
||||
() => {
|
||||
getDataList();
|
||||
myChart.value?.setOption({
|
||||
myChart?.setOption({
|
||||
series: [
|
||||
{
|
||||
data: speedList,
|
||||
|
Loading…
Reference in New Issue
Block a user