config.ts 928 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
  2. import { BarCommonConfig } from './index'
  3. import { ConfigType, CreateComponentType } from '@/packages/index.d'
  4. import omit from 'lodash/omit'
  5. export default class Config extends publicConfig implements CreateComponentType {
  6. public key = BarCommonConfig.key
  7. public chartData: Exclude<ConfigType, ['node']> = omit(BarCommonConfig, ['node'])
  8. // 图表配置项
  9. public option = echartOptionProfixHandle({
  10. tooltip: {
  11. trigger: 'axis',
  12. axisPointer: {
  13. type: 'shadow'
  14. }
  15. },
  16. xAxis: {
  17. type: 'category',
  18. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  19. },
  20. yAxis: {
  21. type: 'value'
  22. },
  23. series: [
  24. {
  25. data: [120, 200, 150, 80, 70, 110, 130],
  26. type: 'bar'
  27. },
  28. {
  29. data: [130, 130, 312, 268, 155, 117, 160],
  30. type: 'bar'
  31. }
  32. ]
  33. })
  34. }