config.ts 858 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
  2. import { LineCommonConfig } from './index'
  3. import { CreateComponentType } from '@/packages/index.d'
  4. import omit from 'lodash/omit'
  5. export const includes = ['legend', 'xAxis', 'yAxis']
  6. const option = {
  7. legend: {
  8. show: true,
  9. },
  10. xAxis: {
  11. show: true,
  12. type: 'category',
  13. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  14. },
  15. yAxis: {
  16. show: true,
  17. type: 'value'
  18. },
  19. series: [
  20. {
  21. name: 'data1',
  22. type: 'line',
  23. data: [120, 200, 150, 80, 70, 110, 130]
  24. }
  25. ]
  26. }
  27. export default class Config extends publicConfig implements CreateComponentType {
  28. public key: string = LineCommonConfig.key
  29. public chartConfig = omit(LineCommonConfig, ['node'])
  30. // 图表配置项
  31. public option = echartOptionProfixHandle(option, includes)
  32. }