55 lines
1.1 KiB
TypeScript
Raw Normal View History

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
export const includes = ['legend']
2022-02-26 17:38:24 +08:00
const option = {
tooltip: {
show: true,
trigger: 'item'
},
legend: {
show: true,
},
2022-03-20 18:11:26 +08:00
dataset: { ...dataJson },
series: [
{
type: 'pie',
2022-02-26 17:38:24 +08:00
radius: ['40%', '65%'],
center: ['50%', '60%'],
avoidLabelOverlap: false,
itemStyle: {
2022-02-24 17:55:29 +08:00
show: true,
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-26 17:38:24 +08:00
}
export default class Config extends PublicConfigClass implements CreateComponentType {
2022-02-02 18:17:45 +08:00
public key: string = PieCommonConfig.key
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
}