62 lines
1.3 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']
const option = echartOptionProfixHandle({
tooltip: {
show: true,
trigger: 'item'
},
legend: {
show: true,
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
itemStyle: {
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' }
]
}
]
}, includes)
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
public chartConfig = omit(PieCommonConfig, ['node'])
2022-02-02 18:17:45 +08:00
// 图表配置项
public option = option
2022-02-02 18:17:45 +08:00
}