CN-1135 fix: 统一各页面环形图样式
This commit is contained in:
@@ -72,33 +72,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
const _this = this
|
||||
const dom = document.getElementById('chart')
|
||||
!this.myChart && (this.myChart = echarts.init(dom))
|
||||
this.chartOption = pieChartOption3
|
||||
this.chartOption.series[0].data = this.chartData
|
||||
this.chartOption.series[0].label = {
|
||||
show: true,
|
||||
position: 'center',
|
||||
fontFamily: 'NotoSansHans-Medium',
|
||||
fontSize: 20,
|
||||
fontWeight: 500,
|
||||
formatter: function () {
|
||||
let num = 0
|
||||
_this.chartData.forEach(t => {
|
||||
num += t.value
|
||||
})
|
||||
return num
|
||||
}
|
||||
show: false
|
||||
}
|
||||
this.myChart.on('mouseover', function () {
|
||||
_this.chartOption.series[0].label.show = false
|
||||
_this.myChart.setOption(_this.chartOption)
|
||||
})
|
||||
this.myChart.on('mouseout', function () {
|
||||
_this.chartOption.series[0].label.show = true
|
||||
_this.myChart.setOption(_this.chartOption)
|
||||
})
|
||||
this.myChart.setOption(this.chartOption)
|
||||
},
|
||||
eventsByTypeData () {
|
||||
|
||||
@@ -138,7 +138,7 @@ export const pieChartOption3 = {
|
||||
avoidLabelOverlap: false,
|
||||
emphasis: {
|
||||
label: {
|
||||
show: true,
|
||||
show: false,
|
||||
fontSize: 20,
|
||||
fontWeight: 500,
|
||||
fontFamily: 'NotoSansHans-Medium',
|
||||
|
||||
Reference in New Issue
Block a user