| | |
| | | <template> |
| | | <div id="class-utilizationRate"> |
| | | |
| | | </div> |
| | | <div id="class-utilizationRate"></div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | components: {}, |
| | | props: { |
| | | dataSource: { |
| | | type: Array, |
| | | }, |
| | | type: Array |
| | | } |
| | | }, |
| | | watch: { |
| | | dataSource: { |
| | |
| | | this.chartContainer = this.$echarts.init(document.getElementById('class-utilizationRate')) |
| | | const option = { |
| | | tooltip: { |
| | | fontSize: this.fontSize(0.12) |
| | | trigger: 'axis', |
| | | fontSize: this.fontSize(0.16) |
| | | }, |
| | | xAxis: [ |
| | | { |
| | |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: '#eee' |
| | | // width:fontSize(0.02) |
| | | } |
| | | } |
| | | } |
| | |
| | | yAxis: [ |
| | | { |
| | | type: 'value', |
| | | // name:'上周开机率', |
| | | axisTick: { |
| | | show: true |
| | | }, |
| | |
| | | legend: { |
| | | pageTextStyle: { |
| | | color: '#eee', |
| | | // fontSize:'100%' |
| | | fontSize: this.fontSize(0.12) |
| | | }, |
| | | top: '2%', |
| | |
| | | } |
| | | }, |
| | | symbolSize: this.fontSize(0.16), |
| | | // data: [38, 30, 44, 65, 23, 42], |
| | | data: this.dataSource, |
| | | itemStyle: { |
| | | normal: { |
| | | // barBorderRadius:[20,20,0,0], |
| | | color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ |
| | | offset: 0, |
| | | color: '#96ceff' |
| | | color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ |
| | | offset: 0, |
| | | color: '#96ceff' |
| | | }, |
| | | { |
| | | offset: 0.6, |
| | | color: '#67c2ff' |
| | | }, |
| | | { |
| | | offset: 0.6, |
| | | color: '#67c2ff' |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: '#1195ff' |
| | | }], false) |
| | | } |
| | | { |
| | | offset: 1, |
| | | color: '#1195ff' |
| | | }], false) |
| | | } |
| | | } |
| | | // { |
| | | // name: '产业园厂区', |
| | | // type: 'bar', |
| | | // axisLabel: { |
| | | // show: true, |
| | | // interval: 'auto', |
| | | // formatter: '{value}%', |
| | | // textStyle: { |
| | | // color: '#eee', |
| | | // fontSize: this.fontSize(0.16), |
| | | // fontWeight: 'bold' |
| | | // } |
| | | // }, |
| | | // symbolSize: this.fontSize(0.16), |
| | | // // data: [52, 44, 65, 59, 43, 21], |
| | | // data: this.dataSource, |
| | | // itemStyle: { |
| | | // normal: { |
| | | // // barBorderRadius:[20,20,0,0], |
| | | // color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{ |
| | | // offset: 0, |
| | | // color: '#ffe9cc' |
| | | // }, |
| | | // { |
| | | // offset: 0.6, |
| | | // color: '#ffd46b' |
| | | // }, |
| | | // { |
| | | // offset: 1, |
| | | // color: '#ffb530' |
| | | // }], false) |
| | | // } |
| | | // } |
| | | // } |
| | | ] |
| | | } |
| | | this.chartContainer.setOption(option, true) |