config.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
  2. import { BarCommonConfig } from './index'
  3. import { CreateComponentType } from '@/packages/index.d'
  4. import cloneDeep from 'lodash/cloneDeep'
  5. export const includes = ['legend', 'xAxis', 'yAxis', 'dataset']
  6. export const option = {
  7. tooltip: {
  8. show: true,
  9. trigger: 'axis',
  10. axisPointer: {
  11. show: true,
  12. type: 'shadow'
  13. }
  14. },
  15. legend: {
  16. show: true
  17. },
  18. xAxis: {
  19. show: true,
  20. type: 'category'
  21. },
  22. yAxis: {
  23. show: true,
  24. type: 'value'
  25. },
  26. series: [
  27. {
  28. type: 'bar',
  29. barWidth: null,
  30. itemStyle: {
  31. color: null,
  32. borderRadius: 0
  33. }
  34. },
  35. {
  36. type: 'bar',
  37. barWidth: null,
  38. itemStyle: {
  39. color: null,
  40. borderRadius: 0
  41. }
  42. }
  43. ]
  44. }
  45. export default class Config extends publicConfig
  46. implements CreateComponentType {
  47. public key = BarCommonConfig.key
  48. public chartConfig = cloneDeep(BarCommonConfig)
  49. // 图表配置项
  50. public option = echartOptionProfixHandle(option, includes)
  51. }