LinearRegressionSlopes.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. *
  3. * (c) 2010-2021 Kamil Kulig
  4. *
  5. * License: www.highcharts.com/license
  6. *
  7. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  8. *
  9. * */
  10. 'use strict';
  11. var __extends = (this && this.__extends) || (function () {
  12. var extendStatics = function (d, b) {
  13. extendStatics = Object.setPrototypeOf ||
  14. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16. return extendStatics(d, b);
  17. };
  18. return function (d, b) {
  19. extendStatics(d, b);
  20. function __() { this.constructor = d; }
  21. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  22. };
  23. })();
  24. import SeriesRegistry from '../../../Core/Series/SeriesRegistry.js';
  25. var _a = SeriesRegistry.seriesTypes, SMAIndicator = _a.sma, LinearRegressionIndicator = _a.linearRegression;
  26. import U from '../../../Core/Utilities.js';
  27. var isArray = U.isArray, extend = U.extend, merge = U.merge;
  28. /* *
  29. *
  30. * Class
  31. *
  32. * */
  33. /**
  34. * The Linear Regression Slope series type.
  35. *
  36. * @private
  37. * @class
  38. * @name Highcharts.seriesTypes.linearRegressionSlope
  39. *
  40. * @augments Highcharts.Series
  41. */
  42. var LinearRegressionSlopesIndicator = /** @class */ (function (_super) {
  43. __extends(LinearRegressionSlopesIndicator, _super);
  44. function LinearRegressionSlopesIndicator() {
  45. var _this = _super !== null && _super.apply(this, arguments) || this;
  46. /* *
  47. *
  48. * Properties
  49. *
  50. * */
  51. _this.data = void 0;
  52. _this.options = void 0;
  53. _this.points = void 0;
  54. return _this;
  55. }
  56. /* *
  57. *
  58. * Functions
  59. *
  60. * */
  61. LinearRegressionSlopesIndicator.prototype.getEndPointY = function (lineParameters) {
  62. return lineParameters.slope;
  63. };
  64. /**
  65. * Linear regression slope indicator. This series requires `linkedTo`
  66. * option to be set.
  67. *
  68. * @sample {highstock} stock/indicators/linear-regression-slope
  69. * Linear regression slope indicator
  70. *
  71. * @extends plotOptions.linearregression
  72. * @since 7.0.0
  73. * @product highstock
  74. * @requires stock/indicators/indicators
  75. * @requires stock/indicators/linearregression
  76. * @optionparent plotOptions.linearregressionslope
  77. */
  78. LinearRegressionSlopesIndicator.defaultOptions = merge(LinearRegressionIndicator.defaultOptions);
  79. return LinearRegressionSlopesIndicator;
  80. }(LinearRegressionIndicator));
  81. extend(LinearRegressionSlopesIndicator.prototype, {
  82. nameBase: 'Linear Regression Slope Indicator'
  83. });
  84. SeriesRegistry.registerSeriesType('linearRegressionSlope', LinearRegressionSlopesIndicator);
  85. /* *
  86. *
  87. * Default Export
  88. *
  89. * */
  90. export default LinearRegressionSlopesIndicator;
  91. /**
  92. * A linear regression intercept series. If the
  93. * [type](#series.linearregressionslope.type) option is not specified, it is
  94. * inherited from [chart.type](#chart.type).
  95. *
  96. * @extends series,plotOptions.linearregressionslope
  97. * @since 7.0.0
  98. * @product highstock
  99. * @excluding dataParser,dataURL
  100. * @requires stock/indicators/indicators
  101. * @requires stock/indicators/linearregressionslope
  102. * @apioption series.linearregressionslope
  103. */
  104. ''; // to include the above in the js output