regressions.src.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. /**
  2. * @license Highstock JS v9.1.1 (2021-06-04)
  3. *
  4. * Indicator series type for Highcharts Stock
  5. *
  6. * (c) 2010-2021 Kamil Kulig
  7. *
  8. * License: www.highcharts.com/license
  9. */
  10. 'use strict';
  11. (function (factory) {
  12. if (typeof module === 'object' && module.exports) {
  13. factory['default'] = factory;
  14. module.exports = factory;
  15. } else if (typeof define === 'function' && define.amd) {
  16. define('highcharts/indicators/regressions', ['highcharts', 'highcharts/modules/stock'], function (Highcharts) {
  17. factory(Highcharts);
  18. factory.Highcharts = Highcharts;
  19. return factory;
  20. });
  21. } else {
  22. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  23. }
  24. }(function (Highcharts) {
  25. var _modules = Highcharts ? Highcharts._modules : {};
  26. function _registerModule(obj, path, args, fn) {
  27. if (!obj.hasOwnProperty(path)) {
  28. obj[path] = fn.apply(null, args);
  29. }
  30. }
  31. _registerModule(_modules, 'Stock/Indicators/LinearRegression/LinearRegression.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
  32. /**
  33. *
  34. * (c) 2010-2021 Kamil Kulig
  35. *
  36. * License: www.highcharts.com/license
  37. *
  38. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  39. *
  40. * */
  41. var __extends = (this && this.__extends) || (function () {
  42. var extendStatics = function (d,
  43. b) {
  44. extendStatics = Object.setPrototypeOf ||
  45. ({ __proto__: [] } instanceof Array && function (d,
  46. b) { d.__proto__ = b; }) ||
  47. function (d,
  48. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  49. return extendStatics(d, b);
  50. };
  51. return function (d, b) {
  52. extendStatics(d, b);
  53. function __() { this.constructor = d; }
  54. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  55. };
  56. })();
  57. var SMAIndicator = SeriesRegistry.seriesTypes.sma;
  58. var isArray = U.isArray,
  59. extend = U.extend,
  60. merge = U.merge;
  61. /* *
  62. *
  63. * Class
  64. *
  65. * */
  66. /**
  67. * Linear regression series type.
  68. *
  69. * @private
  70. * @class
  71. * @name Highcharts.seriesTypes.linearregression
  72. *
  73. * @augments Highcharts.Series
  74. */
  75. var LinearRegressionIndicator = /** @class */ (function (_super) {
  76. __extends(LinearRegressionIndicator, _super);
  77. function LinearRegressionIndicator() {
  78. var _this = _super !== null && _super.apply(this,
  79. arguments) || this;
  80. /* *
  81. *
  82. * Properties
  83. *
  84. * */
  85. _this.data = void 0;
  86. _this.options = void 0;
  87. _this.points = void 0;
  88. return _this;
  89. }
  90. /* *
  91. *
  92. * Functions
  93. *
  94. * */
  95. /**
  96. * Return the slope and intercept of a straight line function.
  97. * @private
  98. * @param {Highcharts.LinearRegressionIndicator} this indicator to use
  99. * @param {Array<number>} xData - list of all x coordinates in a period
  100. * @param {Array<number>} yData - list of all y coordinates in a period
  101. * @return {Highcharts.RegressionLineParametersObject}
  102. * object that contains the slope and the intercept
  103. * of a straight line function
  104. */
  105. LinearRegressionIndicator.prototype.getRegressionLineParameters = function (xData, yData) {
  106. // least squares method
  107. var yIndex = this.options.params.index,
  108. getSingleYValue = function (yValue,
  109. yIndex) {
  110. return isArray(yValue) ? yValue[yIndex] : yValue;
  111. }, xSum = xData.reduce(function (accX, val) {
  112. return val + accX;
  113. }, 0), ySum = yData.reduce(function (accY, val) {
  114. return getSingleYValue(val, yIndex) + accY;
  115. }, 0), xMean = xSum / xData.length, yMean = ySum / yData.length, xError, yError, formulaNumerator = 0, formulaDenominator = 0, i, slope;
  116. for (i = 0; i < xData.length; i++) {
  117. xError = xData[i] - xMean;
  118. yError = getSingleYValue(yData[i], yIndex) - yMean;
  119. formulaNumerator += xError * yError;
  120. formulaDenominator += Math.pow(xError, 2);
  121. }
  122. slope = formulaDenominator ?
  123. formulaNumerator / formulaDenominator : 0; // don't divide by 0
  124. return {
  125. slope: slope,
  126. intercept: yMean - slope * xMean
  127. };
  128. };
  129. /**
  130. * Return the y value on a straight line.
  131. * @private
  132. * @param {Highcharts.RegressionLineParametersObject} lineParameters
  133. * object that contains the slope and the intercept
  134. * of a straight line function
  135. * @param {number} endPointX - x coordinate of the point
  136. * @return {number} - y value of the point that lies on the line
  137. */
  138. LinearRegressionIndicator.prototype.getEndPointY = function (lineParameters, endPointX) {
  139. return lineParameters.slope * endPointX + lineParameters.intercept;
  140. };
  141. /**
  142. * Transform the coordinate system so that x values start at 0 and
  143. * apply xAxisUnit.
  144. * @private
  145. * @param {Array<number>} xData - list of all x coordinates in a period
  146. * @param {number} xAxisUnit - option (see the API)
  147. * @return {Array<number>} - array of transformed x data
  148. */
  149. LinearRegressionIndicator.prototype.transformXData = function (xData, xAxisUnit) {
  150. var xOffset = xData[0];
  151. return xData.map(function (xValue) {
  152. return (xValue - xOffset) / xAxisUnit;
  153. });
  154. };
  155. /**
  156. * Find the closest distance between points in the base series.
  157. * @private
  158. * @param {Array<number>} xData list of all x coordinates in the base series
  159. * @return {number} - closest distance between points in the base series
  160. */
  161. LinearRegressionIndicator.prototype.findClosestDistance = function (xData) {
  162. var distance,
  163. closestDistance,
  164. i;
  165. for (i = 1; i < xData.length - 1; i++) {
  166. distance = xData[i] - xData[i - 1];
  167. if (distance > 0 &&
  168. (typeof closestDistance === 'undefined' ||
  169. distance < closestDistance)) {
  170. closestDistance = distance;
  171. }
  172. }
  173. return closestDistance;
  174. };
  175. // Required to be implemented - starting point for indicator's logic
  176. LinearRegressionIndicator.prototype.getValues = function (baseSeries, regressionSeriesParams) {
  177. var xData = baseSeries.xData,
  178. yData = baseSeries.yData,
  179. period = regressionSeriesParams.period,
  180. lineParameters,
  181. i,
  182. periodStart,
  183. periodEnd,
  184. // format required to be returned
  185. indicatorData = {
  186. xData: [],
  187. yData: [],
  188. values: []
  189. },
  190. endPointX,
  191. endPointY,
  192. periodXData,
  193. periodYData,
  194. periodTransformedXData,
  195. xAxisUnit = this.options.params.xAxisUnit ||
  196. this.findClosestDistance(xData);
  197. // Iteration logic: x value of the last point within the period
  198. // (end point) is used to represent the y value (regression)
  199. // of the entire period.
  200. for (i = period - 1; i <= xData.length - 1; i++) {
  201. periodStart = i - period + 1; // adjusted for slice() function
  202. periodEnd = i + 1; // (as above)
  203. endPointX = xData[i];
  204. periodXData = xData.slice(periodStart, periodEnd);
  205. periodYData = yData.slice(periodStart, periodEnd);
  206. periodTransformedXData = this.transformXData(periodXData, xAxisUnit);
  207. lineParameters = this.getRegressionLineParameters(periodTransformedXData, periodYData);
  208. endPointY = this.getEndPointY(lineParameters, periodTransformedXData[periodTransformedXData.length - 1]);
  209. // @todo this is probably not used anywhere
  210. indicatorData.values.push({
  211. regressionLineParameters: lineParameters,
  212. x: endPointX,
  213. y: endPointY
  214. });
  215. indicatorData.xData.push(endPointX);
  216. indicatorData.yData.push(endPointY);
  217. }
  218. return indicatorData;
  219. };
  220. /**
  221. * Linear regression indicator. This series requires `linkedTo` option to be
  222. * set.
  223. *
  224. * @sample {highstock} stock/indicators/linear-regression
  225. * Linear regression indicator
  226. *
  227. * @extends plotOptions.sma
  228. * @since 7.0.0
  229. * @product highstock
  230. * @requires stock/indicators/indicators
  231. * @requires stock/indicators/linearregression
  232. * @optionparent plotOptions.linearregression
  233. */
  234. LinearRegressionIndicator.defaultOptions = merge(SMAIndicator.defaultOptions, {
  235. params: {
  236. /**
  237. * Unit (in milliseconds) for the x axis distances used to
  238. * compute the regression line paramters (slope & intercept) for
  239. * every range. In Highcharts Stock the x axis values are always
  240. * represented in milliseconds which may cause that distances
  241. * between points are "big" integer numbers.
  242. *
  243. * Highcharts Stock's linear regression algorithm (least squares
  244. * method) will utilize these "big" integers for finding the
  245. * slope and the intercept of the regression line for each
  246. * period. In consequence, this value may be a very "small"
  247. * decimal number that's hard to interpret by a human.
  248. *
  249. * For instance: `xAxisUnit` equealed to `86400000` ms (1 day)
  250. * forces the algorithm to treat `86400000` as `1` while
  251. * computing the slope and the intercept. This may enchance the
  252. * legiblitity of the indicator's values.
  253. *
  254. * Default value is the closest distance between two data
  255. * points.
  256. *
  257. * In `v9.0.2`, the default value has been changed
  258. * from `undefined` to `null`.
  259. *
  260. * @sample {highstock} stock/plotoptions/linear-regression-xaxisunit
  261. * xAxisUnit set to 1 minute
  262. *
  263. * @example
  264. * // In Liniear Regression Slope Indicator series `xAxisUnit`is
  265. * // `86400000` (1 day) and period is `3`. There're 3 points in
  266. * // the base series:
  267. *
  268. * data: [
  269. * [Date.UTC(2020, 0, 1), 1],
  270. * [Date.UTC(2020, 0, 2), 3],
  271. * [Date.UTC(2020, 0, 3), 5]
  272. * ]
  273. *
  274. * // This will produce one point in the indicator series that
  275. * // has a `y` value of `2` (slope of the regression line). If
  276. * // we change the `xAxisUnit` to `1` (ms) the value of the
  277. * // indicator's point will be `2.3148148148148148e-8` which is
  278. * // harder to interpert for a human.
  279. *
  280. * @type {null|number}
  281. * @product highstock
  282. */
  283. xAxisUnit: null
  284. },
  285. tooltip: {
  286. valueDecimals: 4
  287. }
  288. });
  289. return LinearRegressionIndicator;
  290. }(SMAIndicator));
  291. extend(LinearRegressionIndicator.prototype, {
  292. nameBase: 'Linear Regression Indicator'
  293. });
  294. SeriesRegistry.registerSeriesType('linearRegression', LinearRegressionIndicator);
  295. /* *
  296. *
  297. * Default Export
  298. *
  299. * */
  300. /**
  301. * A linear regression series. If the
  302. * [type](#series.linearregression.type) option is not specified, it is
  303. * inherited from [chart.type](#chart.type).
  304. *
  305. * @extends series,plotOptions.linearregression
  306. * @since 7.0.0
  307. * @product highstock
  308. * @excluding dataParser,dataURL
  309. * @requires stock/indicators/indicators
  310. * @requires stock/indicators/linearregression
  311. * @apioption series.linearregression
  312. */
  313. ''; // to include the above in the js output
  314. return LinearRegressionIndicator;
  315. });
  316. _registerModule(_modules, 'Stock/Indicators/LinearRegressionSlopes/LinearRegressionSlopes.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
  317. /**
  318. *
  319. * (c) 2010-2021 Kamil Kulig
  320. *
  321. * License: www.highcharts.com/license
  322. *
  323. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  324. *
  325. * */
  326. var __extends = (this && this.__extends) || (function () {
  327. var extendStatics = function (d,
  328. b) {
  329. extendStatics = Object.setPrototypeOf ||
  330. ({ __proto__: [] } instanceof Array && function (d,
  331. b) { d.__proto__ = b; }) ||
  332. function (d,
  333. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  334. return extendStatics(d, b);
  335. };
  336. return function (d, b) {
  337. extendStatics(d, b);
  338. function __() { this.constructor = d; }
  339. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  340. };
  341. })();
  342. var LinearRegressionIndicator = SeriesRegistry.seriesTypes.linearRegression;
  343. var extend = U.extend,
  344. merge = U.merge;
  345. /* *
  346. *
  347. * Class
  348. *
  349. * */
  350. /**
  351. * The Linear Regression Slope series type.
  352. *
  353. * @private
  354. * @class
  355. * @name Highcharts.seriesTypes.linearRegressionSlope
  356. *
  357. * @augments Highcharts.Series
  358. */
  359. var LinearRegressionSlopesIndicator = /** @class */ (function (_super) {
  360. __extends(LinearRegressionSlopesIndicator, _super);
  361. function LinearRegressionSlopesIndicator() {
  362. var _this = _super !== null && _super.apply(this,
  363. arguments) || this;
  364. /* *
  365. *
  366. * Properties
  367. *
  368. * */
  369. _this.data = void 0;
  370. _this.options = void 0;
  371. _this.points = void 0;
  372. return _this;
  373. }
  374. /* *
  375. *
  376. * Functions
  377. *
  378. * */
  379. LinearRegressionSlopesIndicator.prototype.getEndPointY = function (lineParameters) {
  380. return lineParameters.slope;
  381. };
  382. /**
  383. * Linear regression slope indicator. This series requires `linkedTo`
  384. * option to be set.
  385. *
  386. * @sample {highstock} stock/indicators/linear-regression-slope
  387. * Linear regression slope indicator
  388. *
  389. * @extends plotOptions.linearregression
  390. * @since 7.0.0
  391. * @product highstock
  392. * @requires stock/indicators/indicators
  393. * @requires stock/indicators/linearregression
  394. * @optionparent plotOptions.linearregressionslope
  395. */
  396. LinearRegressionSlopesIndicator.defaultOptions = merge(LinearRegressionIndicator.defaultOptions);
  397. return LinearRegressionSlopesIndicator;
  398. }(LinearRegressionIndicator));
  399. extend(LinearRegressionSlopesIndicator.prototype, {
  400. nameBase: 'Linear Regression Slope Indicator'
  401. });
  402. SeriesRegistry.registerSeriesType('linearRegressionSlope', LinearRegressionSlopesIndicator);
  403. /* *
  404. *
  405. * Default Export
  406. *
  407. * */
  408. /**
  409. * A linear regression intercept series. If the
  410. * [type](#series.linearregressionslope.type) option is not specified, it is
  411. * inherited from [chart.type](#chart.type).
  412. *
  413. * @extends series,plotOptions.linearregressionslope
  414. * @since 7.0.0
  415. * @product highstock
  416. * @excluding dataParser,dataURL
  417. * @requires stock/indicators/indicators
  418. * @requires stock/indicators/linearregressionslope
  419. * @apioption series.linearregressionslope
  420. */
  421. ''; // to include the above in the js output
  422. return LinearRegressionSlopesIndicator;
  423. });
  424. _registerModule(_modules, 'Stock/Indicators/LinearRegressionIntercept/LinearRegressionIntercept.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
  425. /**
  426. *
  427. * (c) 2010-2021 Kamil Kulig
  428. *
  429. * License: www.highcharts.com/license
  430. *
  431. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  432. *
  433. * */
  434. var __extends = (this && this.__extends) || (function () {
  435. var extendStatics = function (d,
  436. b) {
  437. extendStatics = Object.setPrototypeOf ||
  438. ({ __proto__: [] } instanceof Array && function (d,
  439. b) { d.__proto__ = b; }) ||
  440. function (d,
  441. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  442. return extendStatics(d, b);
  443. };
  444. return function (d, b) {
  445. extendStatics(d, b);
  446. function __() { this.constructor = d; }
  447. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  448. };
  449. })();
  450. var LinearRegressionIndicator = SeriesRegistry.seriesTypes.linearRegression;
  451. var extend = U.extend,
  452. merge = U.merge;
  453. /* *
  454. *
  455. * Class
  456. *
  457. * */
  458. /**
  459. * The Linear Regression Intercept series type.
  460. *
  461. * @private
  462. * @class
  463. * @name Highcharts.seriesTypes.linearRegressionIntercept
  464. *
  465. * @augments Highcharts.Series
  466. */
  467. var LinearRegressionInterceptIndicator = /** @class */ (function (_super) {
  468. __extends(LinearRegressionInterceptIndicator, _super);
  469. function LinearRegressionInterceptIndicator() {
  470. var _this = _super !== null && _super.apply(this,
  471. arguments) || this;
  472. /* *
  473. *
  474. * Properties
  475. *
  476. * */
  477. _this.data = void 0;
  478. _this.options = void 0;
  479. _this.points = void 0;
  480. return _this;
  481. }
  482. /* *
  483. *
  484. * Functions
  485. *
  486. * */
  487. LinearRegressionInterceptIndicator.prototype.getEndPointY = function (lineParameters) {
  488. return lineParameters.intercept;
  489. };
  490. /**
  491. * Linear regression intercept indicator. This series requires `linkedTo`
  492. * option to be set.
  493. *
  494. * @sample {highstock} stock/indicators/linear-regression-intercept
  495. * Linear intercept slope indicator
  496. *
  497. * @extends plotOptions.linearregression
  498. * @since 7.0.0
  499. * @product highstock
  500. * @requires stock/indicators/indicators
  501. * @requires stock/indicators/linearregressionintercept
  502. * @optionparent plotOptions.linearregressionintercept
  503. */
  504. LinearRegressionInterceptIndicator.defaultOptions = merge(LinearRegressionIndicator.defaultOptions);
  505. return LinearRegressionInterceptIndicator;
  506. }(LinearRegressionIndicator));
  507. extend(LinearRegressionInterceptIndicator.prototype, {
  508. nameBase: 'Linear Regression Intercept Indicator'
  509. });
  510. SeriesRegistry.registerSeriesType('linearRegressionIntercept', LinearRegressionInterceptIndicator);
  511. /* *
  512. *
  513. * Default Export
  514. *
  515. * */
  516. /**
  517. * A linear regression intercept series. If the
  518. * [type](#series.linearregressionintercept.type) option is not specified, it is
  519. * inherited from [chart.type](#chart.type).
  520. *
  521. * @extends series,plotOptions.linearregressionintercept
  522. * @since 7.0.0
  523. * @product highstock
  524. * @excluding dataParser,dataURL
  525. * @requires stock/indicators/indicators
  526. * @requires stock/indicators/linearregressionintercept
  527. * @apioption series.linearregressionintercept
  528. */
  529. ''; // to include the above in the js output
  530. return LinearRegressionInterceptIndicator;
  531. });
  532. _registerModule(_modules, 'Stock/Indicators/LinearRegressionAngle/LinearRegressionAngle.js', [_modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (SeriesRegistry, U) {
  533. /**
  534. *
  535. * (c) 2010-2021 Kamil Kulig
  536. *
  537. * License: www.highcharts.com/license
  538. *
  539. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  540. *
  541. * */
  542. var __extends = (this && this.__extends) || (function () {
  543. var extendStatics = function (d,
  544. b) {
  545. extendStatics = Object.setPrototypeOf ||
  546. ({ __proto__: [] } instanceof Array && function (d,
  547. b) { d.__proto__ = b; }) ||
  548. function (d,
  549. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  550. return extendStatics(d, b);
  551. };
  552. return function (d, b) {
  553. extendStatics(d, b);
  554. function __() { this.constructor = d; }
  555. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  556. };
  557. })();
  558. var LinearRegressionIndicator = SeriesRegistry.seriesTypes.linearRegression;
  559. var extend = U.extend,
  560. merge = U.merge;
  561. /* *
  562. *
  563. * Class
  564. *
  565. * */
  566. /**
  567. * The Linear Regression Angle series type.
  568. *
  569. * @private
  570. * @class
  571. * @name Highcharts.seriesTypes.linearRegressionAngle
  572. *
  573. * @augments Highcharts.Series
  574. */
  575. var LinearRegressionAngleIndicator = /** @class */ (function (_super) {
  576. __extends(LinearRegressionAngleIndicator, _super);
  577. function LinearRegressionAngleIndicator() {
  578. var _this = _super !== null && _super.apply(this,
  579. arguments) || this;
  580. /* *
  581. *
  582. * Properties
  583. *
  584. * */
  585. _this.data = void 0;
  586. _this.options = void 0;
  587. _this.points = void 0;
  588. return _this;
  589. }
  590. /* *
  591. *
  592. * Functions
  593. *
  594. * */
  595. /**
  596. * Convert a slope of a line to angle (in degrees) between
  597. * the line and x axis
  598. * @private
  599. * @param {number} slope of the straight line function
  600. * @return {number} angle in degrees
  601. */
  602. LinearRegressionAngleIndicator.prototype.slopeToAngle = function (slope) {
  603. return Math.atan(slope) * (180 / Math.PI); // rad to deg
  604. };
  605. LinearRegressionAngleIndicator.prototype.getEndPointY = function (lineParameters) {
  606. return this.slopeToAngle(lineParameters.slope);
  607. };
  608. /**
  609. * Linear regression angle indicator. This series requires `linkedTo`
  610. * option to be set.
  611. *
  612. * @sample {highstock} stock/indicators/linear-regression-angle
  613. * Linear intercept angle indicator
  614. *
  615. * @extends plotOptions.linearregression
  616. * @since 7.0.0
  617. * @product highstock
  618. * @requires stock/indicators/indicators
  619. * @requires stock/indicators/linearregressionangle
  620. * @optionparent plotOptions.linearregressionangle
  621. */
  622. LinearRegressionAngleIndicator.defaultOptions = merge(LinearRegressionIndicator.defaultOptions, {
  623. tooltip: {
  624. pointFormat: '<span style="color:{point.color}">\u25CF</span>' +
  625. '{series.name}: <b>{point.y}°</b><br/>'
  626. }
  627. });
  628. return LinearRegressionAngleIndicator;
  629. }(LinearRegressionIndicator));
  630. extend(LinearRegressionAngleIndicator.prototype, {
  631. nameBase: 'Linear Regression Angle Indicator'
  632. });
  633. SeriesRegistry.registerSeriesType('linearRegressionAngle', LinearRegressionAngleIndicator);
  634. /* *
  635. *
  636. * Default Export
  637. *
  638. * */
  639. /**
  640. * A linear regression intercept series. If the
  641. * [type](#series.linearregressionangle.type) option is not specified, it is
  642. * inherited from [chart.type](#chart.type).
  643. *
  644. * @extends series,plotOptions.linearregressionangle
  645. * @since 7.0.0
  646. * @product highstock
  647. * @excluding dataParser,dataURL
  648. * @requires stock/indicators/indicators
  649. * @requires stock/indicators/linearregressionangle
  650. * @apioption series.linearregressionangle
  651. */
  652. ''; // to include the above in the js output
  653. return LinearRegressionAngleIndicator;
  654. });
  655. _registerModule(_modules, 'masters/indicators/regressions.src.js', [], function () {
  656. // eslint-disable-next-line max-len
  657. // eslint-disable-next-line max-len
  658. });
  659. }));