line.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 line: IChartInfo = {
  10. id: ChartTypes.Line,
  11. name: 'line',
  12. title: '折线图',
  13. icon: 'icon-chart-line',
  14. coordinate: 'cartesian',
  15. rules: [{ dimension: 1, 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. tip: {
  39. title: '提示信息',
  40. type: 'value'
  41. }
  42. },
  43. style: {
  44. spec: {
  45. smooth: false,
  46. step: false
  47. },
  48. label: {
  49. showLabel: false,
  50. labelPosition: CHART_LABEL_POSITIONS[0].value,
  51. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  52. labelFontSize: '12',
  53. labelColor: PIVOT_DEFAULT_FONT_COLOR
  54. },
  55. xAxis: {
  56. showLine: true,
  57. lineStyle: 'solid',
  58. lineSize: '1',
  59. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  60. showLabel: true,
  61. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  62. labelFontSize: '12',
  63. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  64. showInterval: false,
  65. xAxisInterval: 0,
  66. xAxisRotate: 0
  67. },
  68. yAxis: {
  69. showLine: true,
  70. lineStyle: 'solid',
  71. lineSize: '1',
  72. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  73. showLabel: true,
  74. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  75. labelFontSize: '12',
  76. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  77. showTitleAndUnit: true,
  78. titleFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  79. titleFontSize: '12',
  80. titleColor: PIVOT_DEFAULT_FONT_COLOR,
  81. nameLocation: 'middle',
  82. nameRotate: 90,
  83. nameGap: 40,
  84. min: null,
  85. max: null
  86. },
  87. splitLine: {
  88. showHorizontalLine: true,
  89. horizontalLineStyle: 'dashed',
  90. horizontalLineSize: '1',
  91. horizontalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  92. showVerticalLine: false,
  93. verticalLineStyle: 'dashed',
  94. verticalLineSize: '1',
  95. verticalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR
  96. },
  97. legend: {
  98. showLegend: true,
  99. legendPosition: 'right',
  100. selectAll: true,
  101. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  102. fontSize: '12',
  103. color: PIVOT_DEFAULT_FONT_COLOR
  104. }
  105. }
  106. }
  107. export default line