line.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 line: IChartInfo = {
  10. id: PivotTypes.Line,
  11. name: 'line',
  12. title: '折线图',
  13. icon: 'icon-chart-line',
  14. coordinate: 'cartesian',
  15. rules: [{ dimension: [1, 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. spec: {
  49. smooth: false,
  50. step: false
  51. },
  52. xAxis: {
  53. showLine: true,
  54. lineStyle: 'solid',
  55. lineSize: '1',
  56. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  57. showLabel: true,
  58. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  59. labelFontSize: '12',
  60. labelColor: PIVOT_DEFAULT_FONT_COLOR
  61. },
  62. yAxis: {
  63. showLine: true,
  64. lineStyle: 'solid',
  65. lineSize: '1',
  66. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  67. showLabel: true,
  68. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  69. labelFontSize: '12',
  70. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  71. showTitleAndUnit: true,
  72. titleFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  73. titleFontSize: '12',
  74. titleColor: PIVOT_DEFAULT_FONT_COLOR
  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. pivot: {
  87. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  88. fontSize: '12',
  89. color: PIVOT_DEFAULT_FONT_COLOR,
  90. lineStyle: 'solid',
  91. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  92. headerBackgroundColor: PIVOT_DEFAULT_HEADER_BACKGROUND_COLOR
  93. }
  94. }
  95. }
  96. export default line