You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

46 lines
1.1 KiB

<template>
<!-- <div>数据统计组件</div> -->
<div :style="{ width: 'width', height: 'height' }" class="chart-box">
<div id="Sensor" style="width: 100%"></div>
</div>
</template>
<script>
import mixin from './Sensor.js';
// import option from './Sensor3D.js';
export default {
name: 'Sensor',
mixins: [mixin],
data() {
return {
width: '',
height: '',
};
},
mounted() {
this.drawLine();
let wh = window.innerWidth;
let hg = window.innerHeight;
this.width = wh + 'px';
this.height = hg + 'px';
console.log(this.height);
window.onresize = () => {
return (() => {
wh = window.innerWidth;
hg = window.innerHeight;
this.width = wh + 'px';
this.height = hg + 'px';
})();
};
},
methods: {
drawLine() {
// 基于准备好的dom,初始化echarts实例
let myChart = this.$echarts.init(document.getElementById('Sensor'));
// 绘制图表
myChart.setOption(this.option);
},
},
};
</script>
<style lang="stylus" scoped ></style>