修改兼容性

master
suixy 2 months ago
parent 09dddb593d
commit b3eae613f3

@ -38,6 +38,9 @@ const setData = (e) => {
option.value = e;
initChart(e);
};
const on = (a, b) => {
chart.value.on(a, b);
};
const initChart = (option) => {
if (!chart.value) {
chart.value = echarts.init(chartRef.value, 'macarons');
@ -64,6 +67,7 @@ onBeforeUnmount(() => {
window.removeEventListener('resize', resize);
});
defineExpose({
setData
setData,
on
});
</script>

@ -211,7 +211,7 @@ export default {
this.getTreeselect()
this.getTreeMonitorInfo()
// this.getTreeMonitorInfo()
this.getList()
},
watch: {
@ -321,7 +321,7 @@ export default {
x: 'center'
},
grid: {
top: '15%',
top: '40',
bottom: '10%',
left: '10%',
right: '3%'
@ -654,11 +654,11 @@ export default {
this.$refs.Chart4.setData(option4)*/
/* echarts.connect(this.$refs.Chart1.chart, this.$refs.Chart2.chart, this.$refs.Chart3.chart, this.$refs.Chart4.chart)*/
echarts.connect(this.$refs.Chart1.chart)
this.$refs.Chart1.chart.on('datazoom', (e) => {
option.dataZoom[0].start = e.start;
option.dataZoom[0].end = e.end;
this.$refs.Chart1.setData(option);
console.log(this.$refs.Chart1);
this.$refs.Chart1.on('datazoom', (e) => {
option1.dataZoom[0].start = e.start;
option1.dataZoom[0].end = e.end;
this.$refs.Chart1.setData(option1);
});
/* this.$refs.Chart1.chart.on('datazoom', (e) => {

Loading…
Cancel
Save