| | |
| | | } |
| | | } |
| | | }, |
| | | // mounted () { |
| | | // created () { |
| | | // // this.$nextTick(() => { |
| | | // // console.log(1) |
| | | // this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) |
| | | // // } |
| | | // }, |
| | | mounted () { |
| | | this.onSubmit() |
| | | // this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) |
| | | }, |
| | | methods: { |
| | | onSubmit () { |
| | | this.CreateChart() |
| | | console.log(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) |
| | | this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) |
| | | // this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) |
| | | }, |
| | | CreateChart: function (id, title, legend, xdata, ydatas, yname, jcdID, datatype) { |
| | | CreateChart: function () { |
| | | // var id = this.JsonCtarts.id |
| | | // var title = this.JsonCtarts.title |
| | | var legend = this.JsonCtarts.legend |
| | | var xdata = this.JsonCtarts.xdata |
| | | var ydatas = this.JsonCtarts.ydatas |
| | | var yname = this.JsonCtarts.yname |
| | | // var jcdId = this.JsonCtarts.jcdID |
| | | var datatype = this.JsonCtarts.datatype |
| | | |
| | | this.myChart = this.$echarts.init(this.$refs.main) |
| | | // this.myChart.clear() |
| | | this.myChart.clear() |
| | | var dataUnit = '' |
| | | if (datatype === 1) { |
| | | dataUnit = '气量(m³/d)' |
| | |
| | | }, |
| | | legend: { // 图例 |
| | | data: legend |
| | | // color: |
| | | }, |
| | | dataZoom: [{ |
| | | type: 'inside', |
| | |
| | | }], |
| | | series: serLists |
| | | } |
| | | console.log(option) |
| | | this.myChart.setOption(option) |
| | | /* |
| | | this.myChart.on('legendselectchanged', function (params) { |
| | |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |