pie.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import ChartTypes from './ChartTypes'
  2. import {
  3. PIVOT_CHART_FONT_FAMILIES,
  4. PIVOT_DEFAULT_FONT_COLOR,
  5. CHART_PIE_LABEL_POSITIONS
  6. } from 'app/globalConstants'
  7. import { IChartInfo } from 'containers/Widget/components/Widget'
  8. const pie: IChartInfo = {
  9. id: ChartTypes.Pie,
  10. name: 'pie',
  11. title: '饼图',
  12. icon: 'icon-chartpie',
  13. coordinate: 'cartesian',
  14. rules: [{ dimension: [0, 9999], metric: 1 }, { dimension: 0, metric: [2, 9999] }],
  15. dimetionAxis: 'col',
  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. // tip: {
  38. // title: '提示信息',
  39. // type: 'value'
  40. // }
  41. },
  42. style: {
  43. label: {
  44. showLabel: false,
  45. pieLabelPosition: CHART_PIE_LABEL_POSITIONS[0].value,
  46. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  47. labelFontSize: '12',
  48. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  49. labelParts: ['dimensionValue', 'indicatorValue', 'percentage']
  50. },
  51. legend: {
  52. showLegend: true,
  53. legendPosition: 'right',
  54. selectAll: true,
  55. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  56. fontSize: '12',
  57. color: PIVOT_DEFAULT_FONT_COLOR
  58. },
  59. spec: {
  60. roseType: false,
  61. circle: false
  62. }
  63. // toolbox: {
  64. // showToolbox: false
  65. // }
  66. }
  67. }
  68. export default pie