| | |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | isMouse: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | chartData: { |
| | | type: Object, |
| | | required: true, |
| | |
| | | return res * fontSize |
| | | } |
| | | let that = this |
| | | if (this.isMouse) { |
| | | this.chart.on('mouseover', function (params) { |
| | | that.chart.setOption({ |
| | | series: [ |
| | | { |
| | | name: params.seriesName, |
| | | label: { |
| | | show: true, |
| | | fontSize: 16, |
| | | position: [10, -15], |
| | | formatter: '{c}' |
| | | } |
| | | } |
| | | ] |
| | | }) |
| | | }) |
| | | // 增加监听,mouseout事件(鼠标离开) |
| | | this.chart.on('mouseout', function (params) { |
| | | that.chart.setOption({ |
| | | series: [ |
| | | { |
| | | name: params.seriesName, |
| | | lineStyle: { |
| | | width: 2 |
| | | }, |
| | | label: { |
| | | show: false |
| | | }, |
| | | endLabel: { |
| | | show: false |
| | | } |
| | | } |
| | | ] |
| | | }) |
| | | }) |
| | | } |
| | | this.chart.setOption( |
| | | { |
| | | title: { |
| | |
| | | |
| | | yAxis: { |
| | | axisTick: { |
| | | show: false, // 轴线刻度 |
| | | show: true, // 轴线刻度 |
| | | }, |
| | | axisLine: { |
| | | show: true, //不显示坐标轴线 |
| | | }, |
| | | axisLabel: { |
| | | show: true, //不显示坐标轴上的文字 |
| | | } |
| | | // axisLine: { |
| | | // lineStyle: { |
| | | // color: '#000000' |