config.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. showDelay: 0,
  11. axisPointer: {
  12. show: true,
  13. type: 'cross',
  14. lineStyle: {
  15. type: 'dashed',
  16. width: 1
  17. }
  18. }
  19. },
  20. legend: {},
  21. xAxis: {
  22. show: true,
  23. type: 'value',
  24. scale: true,
  25. splitLine: {
  26. show: false
  27. }
  28. },
  29. yAxis: {
  30. show: true,
  31. type: 'value',
  32. scale: true,
  33. splitLine: {
  34. show: false
  35. }
  36. },
  37. series: [
  38. {
  39. type: 'scatter',
  40. emphasis: {
  41. focus: 'self'
  42. },
  43. symbolSize: 12
  44. }
  45. ]
  46. }
  47. export default class Config extends PublicConfigClass implements CreateComponentType {
  48. public key = ScatterBasicConfig.key
  49. public chartConfig = cloneDeep(ScatterBasicConfig)
  50. // 图表配置项
  51. public option = echartOptionProfixHandle(option, includes)
  52. }