doubleYAxis.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 doubleYAxis: IChartInfo = {
  10. id: ChartTypes.DoubleYAxis,
  11. name: 'doubleYAxis',
  12. title: '双Y轴图',
  13. icon: 'icon-duplex',
  14. coordinate: 'cartesian',
  15. rules: [{ dimension: 1, metric: [2, 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. secondaryMetrics: {
  31. title: '右轴指标',
  32. type: 'value'
  33. },
  34. filters: {
  35. title: '筛选',
  36. type: 'all'
  37. }
  38. // color: {
  39. // title: '颜色',
  40. // type: 'category'
  41. // },
  42. // tip: {
  43. // title: '提示信息',
  44. // type: 'value'
  45. // }
  46. },
  47. style: {
  48. spec: {
  49. stack: false,
  50. smooth: false,
  51. step: false,
  52. symbol: true,
  53. label: false
  54. },
  55. doubleYAxis: {
  56. yAxisLeft: 'line',
  57. yAxisRight: 'bar',
  58. yAxisSplitNumber: 5,
  59. dataZoomThreshold: 0,
  60. showLine: true,
  61. lineStyle: 'solid',
  62. lineSize: '1',
  63. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  64. showLabel: true,
  65. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  66. labelFontSize: '12',
  67. labelColor: PIVOT_DEFAULT_FONT_COLOR
  68. },
  69. xAxis: {
  70. showLine: true,
  71. lineStyle: 'solid',
  72. lineSize: '1',
  73. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  74. showLabel: true,
  75. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  76. labelFontSize: '12',
  77. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  78. xAxisInterval: 0,
  79. xAxisRotate: 0
  80. },
  81. splitLine: {
  82. showHorizontalLine: true,
  83. horizontalLineStyle: 'dashed',
  84. horizontalLineSize: '1',
  85. horizontalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  86. showVerticalLine: false,
  87. verticalLineStyle: 'dashed',
  88. verticalLineSize: '1',
  89. verticalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR
  90. },
  91. legend: {
  92. showLegend: true,
  93. legendPosition: 'right',
  94. selectAll: true,
  95. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  96. fontSize: '12',
  97. color: PIVOT_DEFAULT_FONT_COLOR
  98. }
  99. }
  100. }
  101. export default doubleYAxis