bar.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import PivotTypes from './PivotTypes'
  2. import {
  3. PIVOT_DEFAULT_AXIS_LINE_COLOR,
  4. PIVOT_CHART_FONT_FAMILIES,
  5. PIVOT_DEFAULT_FONT_COLOR,
  6. PIVOT_DEFAULT_HEADER_BACKGROUND_COLOR
  7. } from 'app/globalConstants'
  8. import { IChartInfo } from 'containers/Widget/components/Widget'
  9. const bar: IChartInfo = {
  10. id: PivotTypes.Bar,
  11. name: 'bar',
  12. title: '柱状图',
  13. icon: 'icon-chart-bar',
  14. coordinate: 'cartesian',
  15. rules: [{ dimension: [0, 9999], metric: [1, 9999] }],
  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. color: {
  35. title: '颜色',
  36. type: 'category'
  37. },
  38. label: {
  39. title: '标签',
  40. type: 'all'
  41. },
  42. tip: {
  43. title: '提示信息',
  44. type: 'value'
  45. }
  46. },
  47. style: {
  48. xAxis: {
  49. showLine: true,
  50. lineStyle: 'solid',
  51. lineSize: '1',
  52. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  53. showLabel: true,
  54. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  55. labelFontSize: '12',
  56. labelColor: PIVOT_DEFAULT_FONT_COLOR
  57. },
  58. yAxis: {
  59. showLine: true,
  60. lineStyle: 'solid',
  61. lineSize: '1',
  62. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  63. showLabel: true,
  64. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  65. labelFontSize: '12',
  66. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  67. showTitleAndUnit: true,
  68. titleFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  69. titleFontSize: '12',
  70. titleColor: PIVOT_DEFAULT_FONT_COLOR
  71. },
  72. splitLine: {
  73. showHorizontalLine: true,
  74. horizontalLineStyle: 'dashed',
  75. horizontalLineSize: '1',
  76. horizontalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  77. showVerticalLine: false,
  78. verticalLineStyle: 'dashed',
  79. verticalLineSize: '1',
  80. verticalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR
  81. },
  82. pivot: {
  83. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  84. fontSize: '12',
  85. color: PIVOT_DEFAULT_FONT_COLOR,
  86. lineStyle: 'solid',
  87. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  88. headerBackgroundColor: PIVOT_DEFAULT_HEADER_BACKGROUND_COLOR
  89. }
  90. }
  91. }
  92. export default bar