PyramidSeries.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /* *
  2. *
  3. * Highcharts funnel module
  4. *
  5. * (c) 2010-2021 Torstein Honsi
  6. *
  7. * License: www.highcharts.com/license
  8. *
  9. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  10. *
  11. * */
  12. 'use strict';
  13. var __extends = (this && this.__extends) || (function () {
  14. var extendStatics = function (d, b) {
  15. extendStatics = Object.setPrototypeOf ||
  16. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  18. return extendStatics(d, b);
  19. };
  20. return function (d, b) {
  21. extendStatics(d, b);
  22. function __() { this.constructor = d; }
  23. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  24. };
  25. })();
  26. import FunnelSeries from '../Funnel/FunnelSeries.js';
  27. import SeriesRegistry from '../../Core/Series/SeriesRegistry.js';
  28. import U from '../../Core/Utilities.js';
  29. var merge = U.merge;
  30. /* *
  31. *
  32. * Class
  33. *
  34. * */
  35. /**
  36. * Pyramid series type.
  37. *
  38. * @private
  39. * @class
  40. * @name Highcharts.seriesTypes.pyramid
  41. *
  42. * @augments Highcharts.Series
  43. */
  44. var PyramidSeries = /** @class */ (function (_super) {
  45. __extends(PyramidSeries, _super);
  46. function PyramidSeries() {
  47. /* *
  48. *
  49. * Static Properties
  50. *
  51. * */
  52. var _this = _super !== null && _super.apply(this, arguments) || this;
  53. /* *
  54. *
  55. * Properties
  56. *
  57. * */
  58. _this.data = void 0;
  59. _this.options = void 0;
  60. _this.points = void 0;
  61. return _this;
  62. }
  63. /**
  64. * A pyramid series is a special type of funnel, without neck and reversed
  65. * by default.
  66. *
  67. * @sample highcharts/demo/pyramid/
  68. * Pyramid chart
  69. *
  70. * @extends plotOptions.funnel
  71. * @product highcharts
  72. * @requires modules/funnel
  73. * @optionparent plotOptions.pyramid
  74. */
  75. PyramidSeries.defaultOptions = merge(FunnelSeries.defaultOptions, {
  76. /**
  77. * The pyramid neck width is zero by default, as opposed to the funnel,
  78. * which shares the same layout logic.
  79. *
  80. * @since 3.0.10
  81. */
  82. neckWidth: '0%',
  83. /**
  84. * The pyramid neck width is zero by default, as opposed to the funnel,
  85. * which shares the same layout logic.
  86. *
  87. * @since 3.0.10
  88. */
  89. neckHeight: '0%',
  90. /**
  91. * The pyramid is reversed by default, as opposed to the funnel, which
  92. * shares the layout engine, and is not reversed.
  93. *
  94. * @since 3.0.10
  95. */
  96. reversed: true
  97. });
  98. return PyramidSeries;
  99. }(FunnelSeries));
  100. SeriesRegistry.registerSeriesType('pyramid', PyramidSeries);
  101. /* *
  102. *
  103. * Default Export
  104. *
  105. * */
  106. export default PyramidSeries;
  107. /* *
  108. *
  109. * API Options
  110. *
  111. * */
  112. /**
  113. * A `pyramid` series. If the [type](#series.pyramid.type) option is
  114. * not specified, it is inherited from [chart.type](#chart.type).
  115. *
  116. * @extends series,plotOptions.pyramid
  117. * @excluding dataParser, dataURL, stack, xAxis, yAxis, dataSorting,
  118. * boostThreshold, boostBlending
  119. * @product highcharts
  120. * @requires modules/funnel
  121. * @apioption series.pyramid
  122. */
  123. /**
  124. * An array of data points for the series. For the `pyramid` series
  125. * type, points can be given in the following ways:
  126. *
  127. * 1. An array of numerical values. In this case, the numerical values will be
  128. * interpreted as `y` options. Example:
  129. * ```js
  130. * data: [0, 5, 3, 5]
  131. * ```
  132. *
  133. * 2. An array of objects with named values. The following snippet shows only a
  134. * few settings, see the complete options set below. If the total number of
  135. * data points exceeds the series'
  136. * [turboThreshold](#series.pyramid.turboThreshold), this option is not
  137. * available.
  138. * ```js
  139. * data: [{
  140. * y: 9,
  141. * name: "Point2",
  142. * color: "#00FF00"
  143. * }, {
  144. * y: 6,
  145. * name: "Point1",
  146. * color: "#FF00FF"
  147. * }]
  148. * ```
  149. *
  150. * @sample {highcharts} highcharts/chart/reflow-true/
  151. * Numerical values
  152. * @sample {highcharts} highcharts/series/data-array-of-objects/
  153. * Config objects
  154. *
  155. * @type {Array<number|null|*>}
  156. * @extends series.pie.data
  157. * @excluding sliced
  158. * @product highcharts
  159. * @apioption series.pyramid.data
  160. */
  161. ''; // adds doclets above into transpiled file