| | |
| | | } |
| | | }, |
| | | watch: { |
| | | 'cylindricalityData': { |
| | | cylindricalityData: { |
| | | handler(newVal) { |
| | | console.log('newVal', newVal) |
| | | this.seriesData = [] |
| | |
| | | const arr = [] |
| | | |
| | | newVal.forEach(item => { |
| | | arr.push({ |
| | | name: item.name, |
| | | type: 'bar', |
| | | barWidth: '40%', |
| | | data: [item.value] |
| | | }) |
| | | arr.push(item.value) |
| | | this.namelist.push(item.name) |
| | | }) |
| | | this.seriesData = arr |
| | | this.seriesData = [ |
| | | { |
| | | type: 'bar', |
| | | barWidth: '40%', |
| | | data: arr |
| | | } |
| | | ] |
| | | console.log('this.seriesData', this.seriesData) |
| | | console.log('this.namelist', this.namelist) |
| | | this.$nextTick(() => { |
| | | this.initChart() |
| | | }) |
| | |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: [{ |
| | | type: 'category', |
| | | data: this.namelist, |
| | | axisTick: { |
| | | show: false, |
| | | alignWithLabel: true |
| | | }, |
| | | axisLine: { |
| | | show: false |
| | | }, |
| | | axisLabel: { |
| | | color: '#989898' |
| | | } |
| | | }], |
| | | yAxis: [{ |
| | | type: 'value', |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | axisLine: { |
| | | show: false |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: '#ebebeb' |
| | | xAxis: [ |
| | | { |
| | | type: 'category', |
| | | data: this.namelist, |
| | | axisTick: { |
| | | show: false, |
| | | alignWithLabel: true |
| | | }, |
| | | axisLine: { |
| | | show: false |
| | | }, |
| | | axisLabel: { |
| | | color: '#989898' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | color: '#8c8c8c' |
| | | } |
| | | }], |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | type: 'value', |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | axisLine: { |
| | | show: false |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: '#ebebeb' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | color: '#8c8c8c' |
| | | } |
| | | } |
| | | ], |
| | | series: this.seriesData |
| | | }, |
| | | true |