funnel.ts 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import ChartTypes from './ChartTypes'
  2. import {
  3. PIVOT_CHART_FONT_FAMILIES,
  4. PIVOT_DEFAULT_FONT_COLOR,
  5. CHART_FUNNEL_LABEL_POSITIONS,
  6. CHART_SORT_MODES,
  7. CHART_ALIGNMENT_MODES
  8. } from 'app/globalConstants'
  9. import { IChartInfo } from 'containers/Widget/components/Widget'
  10. const funnel: IChartInfo = {
  11. id: ChartTypes.Funnel,
  12. name: 'funnel',
  13. title: '漏斗图',
  14. icon: 'icon-iconloudoutu',
  15. coordinate: 'cartesian',
  16. rules: [{ dimension: [0, 9999], metric: 1 }, { dimension: 0, metric: [2, 9999] }],
  17. dimetionAxis: 'col',
  18. data: {
  19. cols: {
  20. title: '列',
  21. type: 'category'
  22. },
  23. rows: {
  24. title: '行',
  25. type: 'category'
  26. },
  27. metrics: {
  28. title: '指标',
  29. type: 'value'
  30. },
  31. filters: {
  32. title: '筛选',
  33. type: 'all'
  34. },
  35. color: {
  36. title: '颜色',
  37. type: 'category'
  38. }
  39. // tip: {
  40. // title: '提示信息',
  41. // type: 'value'
  42. // }
  43. },
  44. style: {
  45. label: {
  46. showLabel: false,
  47. funnelLabelPosition: CHART_FUNNEL_LABEL_POSITIONS[0].value,
  48. labelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  49. labelFontSize: '12',
  50. labelColor: PIVOT_DEFAULT_FONT_COLOR,
  51. labelParts: ['dimensionValue', 'indicatorValue']
  52. },
  53. legend: {
  54. showLegend: true,
  55. legendPosition: 'right',
  56. selectAll: true,
  57. fontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  58. fontSize: '12',
  59. color: PIVOT_DEFAULT_FONT_COLOR
  60. },
  61. spec: {
  62. sortMode: CHART_SORT_MODES[0].value,
  63. alignmentMode: CHART_ALIGNMENT_MODES[0].value,
  64. gapNumber: 0
  65. }
  66. }
  67. }
  68. export default funnel