BarSeries.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 BaseBarSeriesModel from './BaseBarSeries.js';
  42. import createSeriesData from '../helper/createSeriesData.js';
  43. import { inheritDefaultOption } from '../../util/component.js';
  44. var BarSeriesModel = /** @class */function (_super) {
  45. __extends(BarSeriesModel, _super);
  46. function BarSeriesModel() {
  47. var _this = _super !== null && _super.apply(this, arguments) || this;
  48. _this.type = BarSeriesModel.type;
  49. return _this;
  50. }
  51. BarSeriesModel.prototype.getInitialData = function () {
  52. return createSeriesData(null, this, {
  53. useEncodeDefaulter: true,
  54. createInvertedIndices: !!this.get('realtimeSort', true) || null
  55. });
  56. };
  57. /**
  58. * @override
  59. */
  60. BarSeriesModel.prototype.getProgressive = function () {
  61. // Do not support progressive in normal mode.
  62. return this.get('large') ? this.get('progressive') : false;
  63. };
  64. /**
  65. * @override
  66. */
  67. BarSeriesModel.prototype.getProgressiveThreshold = function () {
  68. // Do not support progressive in normal mode.
  69. var progressiveThreshold = this.get('progressiveThreshold');
  70. var largeThreshold = this.get('largeThreshold');
  71. if (largeThreshold > progressiveThreshold) {
  72. progressiveThreshold = largeThreshold;
  73. }
  74. return progressiveThreshold;
  75. };
  76. BarSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {
  77. return selectors.rect(data.getItemLayout(dataIndex));
  78. };
  79. BarSeriesModel.type = 'series.bar';
  80. BarSeriesModel.dependencies = ['grid', 'polar'];
  81. BarSeriesModel.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {
  82. // If clipped
  83. // Only available on cartesian2d
  84. clip: true,
  85. roundCap: false,
  86. showBackground: false,
  87. backgroundStyle: {
  88. color: 'rgba(180, 180, 180, 0.2)',
  89. borderColor: null,
  90. borderWidth: 0,
  91. borderType: 'solid',
  92. borderRadius: 0,
  93. shadowBlur: 0,
  94. shadowColor: null,
  95. shadowOffsetX: 0,
  96. shadowOffsetY: 0,
  97. opacity: 1
  98. },
  99. select: {
  100. itemStyle: {
  101. borderColor: '#212121'
  102. }
  103. },
  104. realtimeSort: false
  105. });
  106. return BarSeriesModel;
  107. }(BaseBarSeriesModel);
  108. export default BarSeriesModel;