PivotPointsPoint.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* *
  2. *
  3. * License: www.highcharts.com/license
  4. *
  5. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  6. *
  7. * */
  8. var __extends = (this && this.__extends) || (function () {
  9. var extendStatics = function (d, b) {
  10. extendStatics = Object.setPrototypeOf ||
  11. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  12. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  13. return extendStatics(d, b);
  14. };
  15. return function (d, b) {
  16. extendStatics(d, b);
  17. function __() { this.constructor = d; }
  18. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  19. };
  20. })();
  21. import SeriesRegistry from '../../../Core/Series/SeriesRegistry.js';
  22. var SMAIndicator = SeriesRegistry.seriesTypes.sma;
  23. /* eslint-disable valid-jsdoc */
  24. /**
  25. * @private
  26. */
  27. function destroyExtraLabels(point, functionName) {
  28. var props = point.series.pointArrayMap, prop, i = props.length;
  29. SeriesRegistry.seriesTypes.sma.prototype.pointClass.prototype[functionName].call(point);
  30. while (i--) {
  31. prop = 'dataLabel' + props[i];
  32. // S4 dataLabel could be removed by parent method:
  33. if (point[prop] && point[prop].element) {
  34. point[prop].destroy();
  35. }
  36. point[prop] = null;
  37. }
  38. }
  39. /* eslint-enable valid-jsdoc */
  40. /* *
  41. *
  42. * Class
  43. *
  44. * */
  45. var PivotPointsPoint = /** @class */ (function (_super) {
  46. __extends(PivotPointsPoint, _super);
  47. function PivotPointsPoint() {
  48. /**
  49. *
  50. * Properties
  51. *
  52. */
  53. var _this = _super !== null && _super.apply(this, arguments) || this;
  54. _this.P = void 0;
  55. _this.pivotLine = void 0;
  56. _this.series = void 0;
  57. return _this;
  58. }
  59. /**
  60. *
  61. * Functions
  62. *
  63. */
  64. PivotPointsPoint.prototype.destroyElements = function () {
  65. destroyExtraLabels(this, 'destroyElements');
  66. };
  67. // This method is called when removing points, e.g. series.update()
  68. PivotPointsPoint.prototype.destroy = function () {
  69. destroyExtraLabels(this, 'destroyElements');
  70. };
  71. return PivotPointsPoint;
  72. }(SMAIndicator.prototype.pointClass));
  73. /* *
  74. *
  75. * Default Export
  76. *
  77. * */
  78. export default PivotPointsPoint;