| | |
| | | return options |
| | | } |
| | | }, |
| | | methods: { |
| | | onSubmit () { |
| | | console.log('submit!') |
| | | }, |
| | | drawChart: function () { |
| | | const myChart = this.$echarts.init(this.$refs.main) |
| | | myChart.setOption(this.options) |
| | | window.onresize = function () { |
| | | var h1 = document.documentElement.clientHeight// 获取屏幕的高度 |
| | | if (h1 > 700) { |
| | | myChart.getDom().style.height = 3 + 'rem' |
| | | myChart.getDom().style.width = 6 + 'rem' |
| | | } else { |
| | | myChart.getDom().style.height = 3 + 'rem' |
| | | myChart.getDom().style.width = 6 + 'rem' |
| | | } |
| | | myChart.resize() |
| | | } |
| | | } |
| | | }, |
| | | // methods: { |
| | | // // onSubmit () { |
| | | // // console.log('submit!') |
| | | // // }, |
| | | // drawChart: function () { |
| | | // const myChart = this.$echarts.init(this.$refs.main) |
| | | // myChart.setOption(this.options) |
| | | // window.onresize = function () { |
| | | // var h1 = document.documentElement.clientHeight// 获取屏幕的高度 |
| | | // if (h1 > 700) { |
| | | // myChart.getDom().style.height = 3 + 'rem' |
| | | // myChart.getDom().style.width = 6 + 'rem' |
| | | // } else { |
| | | // myChart.getDom().style.height = 3 + 'rem' |
| | | // myChart.getDom().style.width = 6 + 'rem' |
| | | // } |
| | | // myChart.resize() |
| | | // } |
| | | // } |
| | | // }, |
| | | mounted () { |
| | | this.$nextTick(() => { |
| | | this.drawChart() |