BarSeries.js 3.8 KB

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