CandlestickSeries.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 SeriesModel from '../../model/Series.js';
  42. import { WhiskerBoxCommonMixin } from '../helper/whiskerBoxCommon.js';
  43. import { mixin } from 'zrender/lib/core/util.js';
  44. export var SERIES_TYPE_CANDLESTICK = 'candlestick';
  45. var CandlestickSeriesModel = /** @class */function (_super) {
  46. __extends(CandlestickSeriesModel, _super);
  47. function CandlestickSeriesModel() {
  48. var _this = _super !== null && _super.apply(this, arguments) || this;
  49. _this.type = CandlestickSeriesModel.type;
  50. _this.defaultValueDimensions = [{
  51. name: 'open',
  52. defaultTooltip: true
  53. }, {
  54. name: 'close',
  55. defaultTooltip: true
  56. }, {
  57. name: 'lowest',
  58. defaultTooltip: true
  59. }, {
  60. name: 'highest',
  61. defaultTooltip: true
  62. }];
  63. return _this;
  64. }
  65. /**
  66. * Get dimension for shadow in dataZoom
  67. * @return dimension name
  68. */
  69. CandlestickSeriesModel.prototype.getShadowDim = function () {
  70. return 'open';
  71. };
  72. CandlestickSeriesModel.prototype.brushSelector = function (dataIndex, data, selectors) {
  73. var itemLayout = data.getItemLayout(dataIndex);
  74. return itemLayout && selectors.rect(itemLayout.brushRect);
  75. };
  76. CandlestickSeriesModel.type = 'series.' + SERIES_TYPE_CANDLESTICK;
  77. CandlestickSeriesModel.dependencies = ['xAxis', 'yAxis', 'grid'];
  78. CandlestickSeriesModel.defaultOption = {
  79. // zlevel: 0,
  80. z: 2,
  81. coordinateSystem: 'cartesian2d',
  82. legendHoverLink: true,
  83. // xAxisIndex: 0,
  84. // yAxisIndex: 0,
  85. layout: null,
  86. clip: true,
  87. itemStyle: {
  88. color: '#eb5454',
  89. color0: '#47b262',
  90. borderColor: '#eb5454',
  91. borderColor0: '#47b262',
  92. borderColorDoji: null,
  93. // borderColor: '#d24040',
  94. // borderColor0: '#398f4f',
  95. borderWidth: 1
  96. },
  97. emphasis: {
  98. itemStyle: {
  99. borderWidth: 2
  100. }
  101. },
  102. barMaxWidth: null,
  103. barMinWidth: null,
  104. barWidth: null,
  105. large: true,
  106. largeThreshold: 600,
  107. progressive: 3e3,
  108. progressiveThreshold: 1e4,
  109. progressiveChunkMode: 'mod',
  110. animationEasing: 'linear',
  111. animationDuration: 300
  112. };
  113. return CandlestickSeriesModel;
  114. }(SeriesModel);
  115. mixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);
  116. export default CandlestickSeriesModel;