2022-09-12 00:28:13 +08:00
|
|
|
import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
|
2022-02-02 18:17:45 +08:00
|
|
|
import { PieCommonConfig } from './index'
|
2022-02-24 10:21:33 +08:00
|
|
|
import { CreateComponentType } from '@/packages/index.d'
|
2022-03-20 18:11:26 +08:00
|
|
|
import dataJson from './data.json'
|
2022-02-02 18:17:45 +08:00
|
|
|
|
2022-02-24 17:23:20 +08:00
|
|
|
export const includes = ['legend']
|
|
|
|
|
2022-02-26 17:38:24 +08:00
|
|
|
const option = {
|
2022-02-24 17:23:20 +08:00
|
|
|
tooltip: {
|
|
|
|
show: true,
|
|
|
|
trigger: 'item'
|
|
|
|
},
|
|
|
|
legend: {
|
|
|
|
show: true,
|
|
|
|
},
|
2022-03-20 18:11:26 +08:00
|
|
|
dataset: { ...dataJson },
|
2022-02-24 17:23:20 +08:00
|
|
|
series: [
|
|
|
|
{
|
|
|
|
type: 'pie',
|
2022-02-26 17:38:24 +08:00
|
|
|
radius: ['40%', '65%'],
|
2022-02-24 21:02:08 +08:00
|
|
|
center: ['50%', '60%'],
|
2022-02-24 17:23:20 +08:00
|
|
|
avoidLabelOverlap: false,
|
|
|
|
itemStyle: {
|
2022-02-24 17:55:29 +08:00
|
|
|
show: true,
|
2022-02-24 17:23:20 +08:00
|
|
|
borderRadius: 10,
|
|
|
|
borderColor: '#fff',
|
|
|
|
borderWidth: 2
|
|
|
|
},
|
|
|
|
label: {
|
|
|
|
show: false,
|
|
|
|
position: 'center'
|
|
|
|
},
|
|
|
|
emphasis: {
|
|
|
|
label: {
|
|
|
|
show: true,
|
|
|
|
fontSize: '40',
|
|
|
|
fontWeight: 'bold'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
labelLine: {
|
|
|
|
show: false
|
2022-03-20 18:11:26 +08:00
|
|
|
}
|
2022-02-24 17:23:20 +08:00
|
|
|
}
|
|
|
|
]
|
2022-02-26 17:38:24 +08:00
|
|
|
}
|
2022-02-24 17:23:20 +08:00
|
|
|
|
2022-09-12 00:28:13 +08:00
|
|
|
export default class Config extends PublicConfigClass implements CreateComponentType {
|
2022-02-02 18:17:45 +08:00
|
|
|
public key: string = PieCommonConfig.key
|
|
|
|
|
2022-03-10 14:12:26 +08:00
|
|
|
public chartConfig = PieCommonConfig
|
2022-02-02 18:17:45 +08:00
|
|
|
|
|
|
|
// 图表配置项
|
2022-02-26 17:38:24 +08:00
|
|
|
public option = echartOptionProfixHandle(option, includes)
|
2022-02-02 18:17:45 +08:00
|
|
|
}
|