config.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
  2. import { PieCommonConfig } from './index'
  3. import { CreateComponentType } from '@/packages/index.d'
  4. export const includes = ['legend']
  5. const option = {
  6. tooltip: {
  7. show: true,
  8. trigger: 'item'
  9. },
  10. legend: {
  11. show: true,
  12. },
  13. series: [
  14. {
  15. name: 'Access From',
  16. type: 'pie',
  17. radius: ['40%', '65%'],
  18. center: ['50%', '60%'],
  19. avoidLabelOverlap: false,
  20. itemStyle: {
  21. show: true,
  22. borderRadius: 10,
  23. borderColor: '#fff',
  24. borderWidth: 2
  25. },
  26. label: {
  27. show: false,
  28. position: 'center'
  29. },
  30. emphasis: {
  31. label: {
  32. show: true,
  33. fontSize: '40',
  34. fontWeight: 'bold'
  35. }
  36. },
  37. labelLine: {
  38. show: false
  39. },
  40. data: [
  41. { value: 1048, name: 'Search Engine' },
  42. { value: 735, name: 'Direct' },
  43. { value: 580, name: 'Email' },
  44. { value: 484, name: 'Union Ads' },
  45. { value: 300, name: 'Video Ads' }
  46. ]
  47. }
  48. ]
  49. }
  50. export default class Config extends publicConfig implements CreateComponentType {
  51. public key: string = PieCommonConfig.key
  52. public chartConfig = PieCommonConfig
  53. // 图表配置项
  54. public option = echartOptionProfixHandle(option, includes)
  55. }