scatter.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import ChartTypes from './ChartTypes'
  2. import {
  3. PIVOT_DEFAULT_AXIS_LINE_COLOR,
  4. PIVOT_CHART_FONT_FAMILIES,
  5. PIVOT_DEFAULT_FONT_COLOR,
  6. CHART_LABEL_POSITIONS
  7. } from 'app/globalConstants'
  8. import { IChartInfo } from 'containers/Widget/components/Widget'
  9. const scatter: IChartInfo = {
  10. id: ChartTypes.Scatter,
  11. name: 'scatter',
  12. title: '散点图',
  13. icon: 'icon-scatter-chart',
  14. coordinate: 'cartesian',
  15. rules: [{ dimension: [0, 9999], metric: 2 }],
  16. dimetionAxis: 'col',
  17. data: {
  18. cols: {
  19. title: '列',
  20. type: 'category'
  21. },
  22. rows: {
  23. title: '行',
  24. type: 'category'
  25. },
  26. metrics: {
  27. title: '指标',
  28. type: 'value'
  29. },
  30. filters: {
  31. title: '筛选',
  32. type: 'all'
  33. },
  34. size: {
  35. title: '尺寸',
  36. type: 'value'
  37. },
  38. color: {
  39. title: '颜色',
  40. type: 'category'
  41. },
  42. tip: {
  43. title: '提示信息',
  44. type: 'value'
  45. }
  46. },
  47. style: {
  48. spec: {
  49. },
  50. label: {
  51. showLabel: false,
  52. labelPosition: CHART_LABEL_POSITIONS[0].value,
  53. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  54. labelFontSize: '12',
  55. labelColor: PIVOT_DEFAULT_FONT_COLOR
  56. },
  57. xAxis: {
  58. showLine: true,
  59. lineStyle: 'solid',
  60. lineSize: '1',
  61. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  62. showLabel: true,
  63. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  64. labelFontSize: '12',
  65. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  66. showTitleAndUnit: true,
  67. titleFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  68. titleFontSize: '12',
  69. titleColor: PIVOT_DEFAULT_FONT_COLOR,
  70. nameLocation: 'middle',
  71. nameRotate: 90,
  72. nameGap: 40,
  73. min: null,
  74. max: null
  75. },
  76. yAxis: {
  77. showLine: true,
  78. lineStyle: 'solid',
  79. lineSize: '1',
  80. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  81. showLabel: true,
  82. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  83. labelFontSize: '12',
  84. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  85. showTitleAndUnit: true,
  86. titleFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  87. titleFontSize: '12',
  88. titleColor: PIVOT_DEFAULT_FONT_COLOR,
  89. nameLocation: 'middle',
  90. nameRotate: 90,
  91. nameGap: 40,
  92. min: null,
  93. max: null
  94. },
  95. splitLine: {
  96. showHorizontalLine: true,
  97. horizontalLineStyle: 'dashed',
  98. horizontalLineSize: '1',
  99. horizontalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  100. showVerticalLine: false,
  101. verticalLineStyle: 'dashed',
  102. verticalLineSize: '1',
  103. verticalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR
  104. },
  105. legend: {
  106. showLegend: true,
  107. legendPosition: 'right',
  108. selectAll: true,
  109. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  110. fontSize: '12',
  111. color: PIVOT_DEFAULT_FONT_COLOR
  112. }
  113. }
  114. }
  115. export default scatter