CandlestickSeries.js 3.8 KB

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