config.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
  2. import { ScatterBasicConfig } from './index'
  3. import { CreateComponentType } from '@/packages/index.d'
  4. import cloneDeep from 'lodash/cloneDeep'
  5. import dataJson from './data.json'
  6. export const includes = ['legend', 'xAxis', 'yAxis']
  7. export const option = {
  8. dataset: dataJson,
  9. tooltip: {
  10. // trigger: 'axis',
  11. showDelay: 0,
  12. axisPointer: {
  13. show: true,
  14. type: 'cross',
  15. lineStyle: {
  16. type: 'dashed',
  17. width: 1
  18. }
  19. }
  20. },
  21. legend: {},
  22. xAxis: {
  23. show: true,
  24. type: 'value',
  25. scale: true,
  26. splitLine: {
  27. show: false
  28. }
  29. },
  30. yAxis: {
  31. show: true,
  32. type: 'value',
  33. scale: true,
  34. splitLine: {
  35. show: false
  36. }
  37. },
  38. series: [
  39. {
  40. type: 'scatter',
  41. emphasis: {
  42. focus: 'self'
  43. },
  44. symbolSize: 12
  45. }
  46. ]
  47. }
  48. export default class Config extends PublicConfigClass implements CreateComponentType {
  49. public key = ScatterBasicConfig.key
  50. public chartConfig = cloneDeep(ScatterBasicConfig)
  51. // 图表配置项
  52. public option = echartOptionProfixHandle(option, includes)
  53. }