pie.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 pie: IChartInfo = {
  10. id: PivotTypes.Pie,
  11. name: 'pie',
  12. title: '饼图',
  13. icon: 'icon-chartpie',
  14. coordinate: 'polar',
  15. rules: [{ dimension: [0, 9999], metric: [1, 9999] }],
  16. data: {
  17. cols: {
  18. title: '列',
  19. type: 'category'
  20. },
  21. rows: {
  22. title: '行',
  23. type: 'category'
  24. },
  25. metrics: {
  26. title: '指标',
  27. type: 'value'
  28. },
  29. filters: {
  30. title: '筛选',
  31. type: 'all'
  32. },
  33. color: {
  34. title: '颜色',
  35. type: 'category'
  36. },
  37. label: {
  38. title: '标签',
  39. type: 'all'
  40. },
  41. tip: {
  42. title: '提示信息',
  43. type: 'value'
  44. }
  45. },
  46. style: {
  47. spec: {
  48. circle: false
  49. },
  50. xAxis: {
  51. showLine: true,
  52. lineStyle: 'solid',
  53. lineSize: '1',
  54. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  55. showLabel: true,
  56. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  57. labelFontSize: '12',
  58. labelColor: PIVOT_DEFAULT_FONT_COLOR
  59. },
  60. splitLine: {
  61. showHorizontalLine: true,
  62. horizontalLineStyle: 'dashed',
  63. horizontalLineSize: '1',
  64. horizontalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  65. showVerticalLine: false,
  66. verticalLineStyle: 'dashed',
  67. verticalLineSize: '1',
  68. verticalLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR
  69. },
  70. pivot: {
  71. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  72. fontSize: '12',
  73. color: PIVOT_DEFAULT_FONT_COLOR,
  74. lineStyle: 'solid',
  75. lineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  76. headerBackgroundColor: PIVOT_DEFAULT_HEADER_BACKGROUND_COLOR
  77. }
  78. }
  79. }
  80. export default pie