waterfall.ts 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 waterfall: IChartInfo = {
  10. id: ChartTypes.Waterfall,
  11. name: 'waterfall',
  12. title: '瀑布图',
  13. icon: 'icon-waterfall',
  14. coordinate: 'cartesian',
  15. rules: [{ dimension: 1, metric: 1 }],
  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. },
  35. style: {
  36. spec: {
  37. },
  38. label: {
  39. showLabel: false,
  40. labelPosition: CHART_LABEL_POSITIONS[0].value,
  41. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  42. labelFontSize: '12',
  43. labelColor: PIVOT_DEFAULT_FONT_COLOR
  44. },
  45. xAxis: {
  46. showLine: true,
  47. lineStyle: 'solid',
  48. lineSize: '1',
  49. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  50. showLabel: true,
  51. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  52. labelFontSize: '12',
  53. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  54. xAxisInterval: 0,
  55. xAxisRotate: 0
  56. },
  57. yAxis: {
  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. splitLine: {
  77. showHorizontalLine: true,
  78. horizontalLineStyle: 'dashed',
  79. horizontalLineSize: '1',
  80. horizontalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  81. showVerticalLine: false,
  82. verticalLineStyle: 'dashed',
  83. verticalLineSize: '1',
  84. verticalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR
  85. }
  86. }
  87. }
  88. export default waterfall