parallel.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import ChartTypes from './ChartTypes'
  2. import {
  3. PIVOT_BORDER,
  4. PIVOT_CHART_ELEMENT_MIN_WIDTH,
  5. PIVOT_CHART_FONT_FAMILIES,
  6. PIVOT_DEFAULT_AXIS_LINE_COLOR,
  7. PIVOT_DEFAULT_FONT_COLOR,
  8. CHART_PIE_LABEL_POSITIONS,
  9. DEFAULT_FONT_STYLE
  10. } from 'app/globalConstants'
  11. import {
  12. IChartInfo
  13. } from 'containers/Widget/components/Widget'
  14. const parallel: IChartInfo = {
  15. id: ChartTypes.Parallel,
  16. name: 'parallel',
  17. title: '平行坐标图',
  18. icon: 'icon-parallel',
  19. coordinate: 'cartesian',
  20. rules: [{ dimension: [1, 9999], metric: [1, 9999] }],
  21. dimetionAxis: 'col',
  22. data: {
  23. cols: {
  24. title: '列',
  25. type: 'category'
  26. },
  27. rows: {
  28. title: '行',
  29. type: 'category'
  30. },
  31. metrics: {
  32. title: '指标',
  33. type: 'value'
  34. },
  35. filters: {
  36. title: '筛选',
  37. type: 'all'
  38. },
  39. color: {
  40. title: '颜色',
  41. type: 'category'
  42. }
  43. // tip: {
  44. // title: '提示信息',
  45. // type: 'value'
  46. // }
  47. },
  48. style: {
  49. axis: {
  50. inverse: false,
  51. showLine: true,
  52. lineStyle: 'solid',
  53. lineSize: '1',
  54. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  55. showLabel: true,
  56. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  57. labelFontSize: '12',
  58. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  59. showTitleAndUnit: true,
  60. nameLocation: 'start',
  61. nameRotate: 0,
  62. nameGap: 20,
  63. titleFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  64. titleFontStyle: DEFAULT_FONT_STYLE,
  65. titleFontSize: '12',
  66. titleColor: PIVOT_DEFAULT_FONT_COLOR
  67. },
  68. legend: {
  69. showLegend: true,
  70. legendPosition: 'right',
  71. selectAll: true,
  72. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  73. fontSize: '12',
  74. color: PIVOT_DEFAULT_FONT_COLOR
  75. },
  76. areaSelect: {
  77. width: PIVOT_CHART_ELEMENT_MIN_WIDTH,
  78. borderWidth: PIVOT_BORDER,
  79. borderColor: '#a0c5e8',
  80. color: '#a0c5e8',
  81. opacity: 0.3
  82. },
  83. spec: {
  84. layout: 'horizontal',
  85. smooth: false
  86. }
  87. }
  88. }
  89. export default parallel