gauge.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * <<
  3. * Davinci
  4. * ==
  5. * Copyright (C) 2016 - 2017 EDP
  6. * ==
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. * >>
  19. */
  20. import ChartTypes from './ChartTypes'
  21. import {
  22. PIVOT_CHART_FONT_FAMILIES,
  23. PIVOT_DEFAULT_FONT_COLOR,
  24. PIVOT_DEFAULT_AXIS_LINE_COLOR,
  25. CHART_FUNNEL_LABEL_POSITIONS,
  26. CHART_SORT_MODES,
  27. CHART_ALIGNMENT_MODES,
  28. DEFAULT_FONT_STYLE,
  29. DEFAULT_ECHARTS_THEME
  30. } from 'app/globalConstants'
  31. import { IChartInfo } from 'app/containers/Widget/components/Widget'
  32. const gauge: IChartInfo = {
  33. id: ChartTypes.Gauge,
  34. name: 'gauge',
  35. title: '仪表盘',
  36. icon: 'icon-gauge',
  37. coordinate: 'polar',
  38. rules: [{ dimension: 0, metric: 1 }],
  39. dimetionAxis: 'col',
  40. data: {
  41. cols: {
  42. title: '列',
  43. type: 'category'
  44. },
  45. rows: {
  46. title: '行',
  47. type: 'category'
  48. },
  49. metrics: {
  50. title: '指标',
  51. type: 'value'
  52. },
  53. filters: {
  54. title: '筛选',
  55. type: 'all'
  56. }
  57. },
  58. style: {
  59. gauge: {
  60. radius: 75,
  61. splitNumber: 10,
  62. startAngle: 225,
  63. endAngle: -45,
  64. clockwise: true,
  65. max: 100,
  66. prefix: '',
  67. suffix: '%',
  68. showTitle: true,
  69. titleFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  70. titleFontSize: '16',
  71. titleColor: PIVOT_DEFAULT_FONT_COLOR,
  72. titleOffsetLeft: 0,
  73. titleOffsetTop: -40,
  74. showDetail: true,
  75. detailFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  76. detailFontSize: '28',
  77. detailColor: PIVOT_DEFAULT_FONT_COLOR,
  78. detailOffsetLeft: 0,
  79. detailOffsetTop: 40,
  80. showPointer: true,
  81. pointerLength: 80,
  82. pointerWidth: 8,
  83. customPointerColor: false,
  84. pointerColor: DEFAULT_ECHARTS_THEME.color[0],
  85. pointerBorderStyle: 'solid',
  86. pointerBorderWidth: 0,
  87. pointerBorderColor: PIVOT_DEFAULT_AXIS_LINE_COLOR,
  88. axisLineSize: 30,
  89. axisLineColor: DEFAULT_ECHARTS_THEME.color[0],
  90. showAxisTick: true,
  91. showAxisLabel: true,
  92. axisLabelDistance: 5,
  93. axisLabelFontFamily: PIVOT_CHART_FONT_FAMILIES[0].value,
  94. axisLabelFontSize: '12',
  95. axisLabelColor: PIVOT_DEFAULT_FONT_COLOR,
  96. showSplitLine: true,
  97. splitLineLength: 30,
  98. splitLineSize: '1',
  99. splitLineStyle: 'solid',
  100. splitLineColor: PIVOT_DEFAULT_AXIS_LINE_COLOR
  101. }
  102. }
  103. }
  104. export default gauge