GaugeSeries.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. /**
  20. * AUTO-GENERATED FILE. DO NOT MODIFY.
  21. */
  22. /*
  23. * Licensed to the Apache Software Foundation (ASF) under one
  24. * or more contributor license agreements. See the NOTICE file
  25. * distributed with this work for additional information
  26. * regarding copyright ownership. The ASF licenses this file
  27. * to you under the Apache License, Version 2.0 (the
  28. * "License"); you may not use this file except in compliance
  29. * with the License. You may obtain a copy of the License at
  30. *
  31. * http://www.apache.org/licenses/LICENSE-2.0
  32. *
  33. * Unless required by applicable law or agreed to in writing,
  34. * software distributed under the License is distributed on an
  35. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  36. * KIND, either express or implied. See the License for the
  37. * specific language governing permissions and limitations
  38. * under the License.
  39. */
  40. import { __extends } from "tslib";
  41. import createSeriesDataSimply from '../helper/createSeriesDataSimply.js';
  42. import SeriesModel from '../../model/Series.js';
  43. import tokens from '../../visual/tokens.js';
  44. var GaugeSeriesModel = /** @class */function (_super) {
  45. __extends(GaugeSeriesModel, _super);
  46. function GaugeSeriesModel() {
  47. var _this = _super !== null && _super.apply(this, arguments) || this;
  48. _this.type = GaugeSeriesModel.type;
  49. _this.visualStyleAccessPath = 'itemStyle';
  50. return _this;
  51. }
  52. GaugeSeriesModel.prototype.getInitialData = function (option, ecModel) {
  53. return createSeriesDataSimply(this, ['value']);
  54. };
  55. GaugeSeriesModel.type = 'series.gauge';
  56. GaugeSeriesModel.defaultOption = {
  57. // zlevel: 0,
  58. z: 2,
  59. colorBy: 'data',
  60. // 默认全局居中
  61. center: ['50%', '50%'],
  62. legendHoverLink: true,
  63. radius: '75%',
  64. startAngle: 225,
  65. endAngle: -45,
  66. clockwise: true,
  67. // 最小值
  68. min: 0,
  69. // 最大值
  70. max: 100,
  71. // 分割段数,默认为10
  72. splitNumber: 10,
  73. // 坐标轴线
  74. axisLine: {
  75. // 默认显示,属性show控制显示与否
  76. show: true,
  77. roundCap: false,
  78. lineStyle: {
  79. color: [[1, tokens.color.neutral10]],
  80. width: 10
  81. }
  82. },
  83. // 坐标轴线
  84. progress: {
  85. // 默认显示,属性show控制显示与否
  86. show: false,
  87. overlap: true,
  88. width: 10,
  89. roundCap: false,
  90. clip: true
  91. },
  92. // 分隔线
  93. splitLine: {
  94. // 默认显示,属性show控制显示与否
  95. show: true,
  96. // 属性length控制线长
  97. length: 10,
  98. distance: 10,
  99. // 属性lineStyle(详见lineStyle)控制线条样式
  100. lineStyle: {
  101. color: tokens.color.axisTick,
  102. width: 3,
  103. type: 'solid'
  104. }
  105. },
  106. // 坐标轴小标记
  107. axisTick: {
  108. // 属性show控制显示与否,默认不显示
  109. show: true,
  110. // 每份split细分多少段
  111. splitNumber: 5,
  112. // 属性length控制线长
  113. length: 6,
  114. distance: 10,
  115. // 属性lineStyle控制线条样式
  116. lineStyle: {
  117. color: tokens.color.axisTickMinor,
  118. width: 1,
  119. type: 'solid'
  120. }
  121. },
  122. axisLabel: {
  123. show: true,
  124. distance: 15,
  125. // formatter: null,
  126. color: tokens.color.axisLabel,
  127. fontSize: 12,
  128. rotate: 0
  129. },
  130. pointer: {
  131. icon: null,
  132. offsetCenter: [0, 0],
  133. show: true,
  134. showAbove: true,
  135. length: '60%',
  136. width: 6,
  137. keepAspect: false
  138. },
  139. anchor: {
  140. show: false,
  141. showAbove: false,
  142. size: 6,
  143. icon: 'circle',
  144. offsetCenter: [0, 0],
  145. keepAspect: false,
  146. itemStyle: {
  147. color: tokens.color.neutral00,
  148. borderWidth: 0,
  149. borderColor: tokens.color.theme[0]
  150. }
  151. },
  152. title: {
  153. show: true,
  154. // x, y,单位px
  155. offsetCenter: [0, '20%'],
  156. // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  157. color: tokens.color.secondary,
  158. fontSize: 16,
  159. valueAnimation: false
  160. },
  161. detail: {
  162. show: true,
  163. backgroundColor: tokens.color.transparent,
  164. borderWidth: 0,
  165. borderColor: tokens.color.neutral40,
  166. width: 100,
  167. height: null,
  168. padding: [5, 10],
  169. // x, y,单位px
  170. offsetCenter: [0, '40%'],
  171. // formatter: null,
  172. // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  173. color: tokens.color.primary,
  174. fontSize: 30,
  175. fontWeight: 'bold',
  176. lineHeight: 30,
  177. valueAnimation: false
  178. }
  179. };
  180. return GaugeSeriesModel;
  181. }(SeriesModel);
  182. export default GaugeSeriesModel;