62 lines
1.4 KiB
TypeScript
Raw Normal View History

2022-02-08 19:39:57 +08:00
import { echartOptionProfixHandle, publicConfig } 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-02-02 18:17:45 +08:00
import omit from 'lodash/omit'
export const includes = ['legend']
2022-02-26 17:38:24 +08:00
const option = {
tooltip: {
show: true,
trigger: 'item'
},
legend: {
show: true,
},
series: [
{
name: 'Access From',
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
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
2022-02-26 17:38:24 +08:00
}
2022-02-06 01:04:05 +08:00
export default class Config extends publicConfig implements CreateComponentType {
2022-02-02 18:17:45 +08:00
public key: string = PieCommonConfig.key
2022-03-09 19:22:58 +08:00
public chartConfig = omit(PieCommonConfig, ['node', 'conNode'])
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
}