| | |
| | | this.initChart() |
| | | }, |
| | | methods: { |
| | | |
| | | |
| | | |
| | | async initChart() { |
| | | |
| | | |
| | | let data = [ |
| | | { |
| | | name: "user1", |
| | |
| | | let yAxis = [] |
| | | if (res.code == 200) { |
| | | data = res.result.map(item => { |
| | | xAxis.push(item.name); |
| | | yAxis.push(item.count); |
| | | xAxis.push(item.name) |
| | | yAxis.push(item.count) |
| | | }) |
| | | } |
| | | let option = { |
| | |
| | | right: "10%", |
| | | bottom: "15%", |
| | | }, |
| | | |
| | | tooltip: { |
| | | show: true |
| | | }, |
| | | xAxis: { |
| | | data: xAxis, |
| | | axisLabel: { |
| | |
| | | yAxis: { |
| | | axisLine: { |
| | | show: false, |
| | | |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | |
| | | lineStyle: { |
| | | color: "#5d7289", |
| | | width: 1, |
| | | type: "dashed" |
| | | } |
| | | type: "dashed", |
| | | }, |
| | | }, |
| | | }, |
| | | series: [ |
| | |
| | | data: yAxis, |
| | | }, |
| | | ], |
| | | }; |
| | | } |
| | | |
| | | const chart = echarts.init(this.$refs.chart) |
| | | |