funnel.src.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. /**
  2. * @license Highcharts JS v9.1.1 (2021-06-04)
  3. *
  4. * Highcharts funnel module
  5. *
  6. * (c) 2010-2021 Torstein Honsi
  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/modules/funnel', ['highcharts'], 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, 'Series/Funnel/FunnelSeries.js', [_modules['Core/Chart/Chart.js'], _modules['Core/Globals.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (Chart, H, palette, SeriesRegistry, U) {
  32. /* *
  33. *
  34. * Highcharts funnel module
  35. *
  36. * (c) 2010-2021 Torstein Honsi
  37. *
  38. * License: www.highcharts.com/license
  39. *
  40. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  41. *
  42. * */
  43. var __extends = (this && this.__extends) || (function () {
  44. var extendStatics = function (d,
  45. b) {
  46. extendStatics = Object.setPrototypeOf ||
  47. ({ __proto__: [] } instanceof Array && function (d,
  48. b) { d.__proto__ = b; }) ||
  49. function (d,
  50. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  51. return extendStatics(d, b);
  52. };
  53. return function (d, b) {
  54. extendStatics(d, b);
  55. function __() { this.constructor = d; }
  56. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  57. };
  58. })();
  59. var noop = H.noop;
  60. var Series = SeriesRegistry.series,
  61. PieSeries = SeriesRegistry.seriesTypes.pie;
  62. var addEvent = U.addEvent,
  63. extend = U.extend,
  64. fireEvent = U.fireEvent,
  65. isArray = U.isArray,
  66. merge = U.merge,
  67. pick = U.pick;
  68. /**
  69. * @private
  70. * @class
  71. * @name Highcharts.seriesTypes.funnel
  72. *
  73. * @augments Highcharts.Series
  74. */
  75. var FunnelSeries = /** @class */ (function (_super) {
  76. __extends(FunnelSeries, _super);
  77. function FunnelSeries() {
  78. /* *
  79. *
  80. * Static Properties
  81. *
  82. * */
  83. var _this = _super !== null && _super.apply(this,
  84. arguments) || this;
  85. _this.data = void 0;
  86. _this.options = void 0;
  87. _this.points = void 0;
  88. return _this;
  89. /* eslint-enable valid-jsdoc */
  90. }
  91. /* *
  92. *
  93. * Functions
  94. *
  95. * */
  96. /* eslint-disable valid-jsdoc */
  97. /**
  98. * @private
  99. */
  100. FunnelSeries.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {
  101. var series = point.series,
  102. reversed = series.options.reversed,
  103. dlBox = point.dlBox || point.shapeArgs,
  104. align = options.align,
  105. verticalAlign = options.verticalAlign,
  106. inside = ((series.options || {}).dataLabels || {}).inside,
  107. centerY = series.center[1],
  108. pointPlotY = (reversed ?
  109. 2 * centerY - point.plotY :
  110. point.plotY),
  111. widthAtLabel = series.getWidthAt(pointPlotY - dlBox.height / 2 +
  112. dataLabel.height),
  113. offset = verticalAlign === 'middle' ?
  114. (dlBox.topWidth - dlBox.bottomWidth) / 4 :
  115. (widthAtLabel - dlBox.bottomWidth) / 2,
  116. y = dlBox.y,
  117. x = dlBox.x;
  118. if (verticalAlign === 'middle') {
  119. y = dlBox.y - dlBox.height / 2 + dataLabel.height / 2;
  120. }
  121. else if (verticalAlign === 'top') {
  122. y = dlBox.y - dlBox.height + dataLabel.height +
  123. options.padding;
  124. }
  125. if (verticalAlign === 'top' && !reversed ||
  126. verticalAlign === 'bottom' && reversed ||
  127. verticalAlign === 'middle') {
  128. if (align === 'right') {
  129. x = dlBox.x - options.padding + offset;
  130. }
  131. else if (align === 'left') {
  132. x = dlBox.x + options.padding - offset;
  133. }
  134. }
  135. alignTo = {
  136. x: x,
  137. y: reversed ? y - dlBox.height : y,
  138. width: dlBox.bottomWidth,
  139. height: dlBox.height
  140. };
  141. options.verticalAlign = 'bottom';
  142. // Call the parent method
  143. if (!inside || point.visible) {
  144. Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew);
  145. }
  146. if (inside) {
  147. if (!point.visible && point.dataLabel) {
  148. // Avoid animation from top
  149. point.dataLabel.placed = false;
  150. }
  151. // If label is inside and we have contrast, set it:
  152. if (point.contrastColor) {
  153. dataLabel.css({
  154. color: point.contrastColor
  155. });
  156. }
  157. }
  158. };
  159. /**
  160. * Extend the pie data label method.
  161. * @private
  162. */
  163. FunnelSeries.prototype.drawDataLabels = function () {
  164. var series = this,
  165. data = series.data,
  166. labelDistance = series.options.dataLabels.distance,
  167. leftSide,
  168. sign,
  169. point,
  170. i = data.length,
  171. x,
  172. y;
  173. // In the original pie label anticollision logic, the slots are
  174. // distributed from one labelDistance above to one labelDistance
  175. // below the pie. In funnels we don't want this.
  176. series.center[2] -= 2 * labelDistance;
  177. // Set the label position array for each point.
  178. while (i--) {
  179. point = data[i];
  180. leftSide = point.half;
  181. sign = leftSide ? 1 : -1;
  182. y = point.plotY;
  183. point.labelDistance = pick(point.options.dataLabels &&
  184. point.options.dataLabels.distance, labelDistance);
  185. series.maxLabelDistance = Math.max(point.labelDistance, series.maxLabelDistance || 0);
  186. x = series.getX(y, leftSide, point);
  187. // set the anchor point for data labels
  188. point.labelPosition = {
  189. // initial position of the data label - it's utilized for
  190. // finding the final position for the label
  191. natural: {
  192. x: 0,
  193. y: y
  194. },
  195. 'final': {
  196. // used for generating connector path -
  197. // initialized later in drawDataLabels function
  198. // x: undefined,
  199. // y: undefined
  200. },
  201. // left - funnel on the left side of the data label
  202. // right - funnel on the right side of the data label
  203. alignment: leftSide ? 'right' : 'left',
  204. connectorPosition: {
  205. breakAt: {
  206. x: x + (point.labelDistance - 5) * sign,
  207. y: y
  208. },
  209. touchingSliceAt: {
  210. x: x + point.labelDistance * sign,
  211. y: y
  212. }
  213. }
  214. };
  215. }
  216. SeriesRegistry.seriesTypes[series.options.dataLabels.inside ? 'column' : 'pie'].prototype.drawDataLabels.call(this);
  217. };
  218. /**
  219. * Overrides the pie translate method.
  220. * @private
  221. */
  222. FunnelSeries.prototype.translate = function () {
  223. var sum = 0,
  224. series = this,
  225. chart = series.chart,
  226. options = series.options,
  227. reversed = options.reversed,
  228. ignoreHiddenPoint = options.ignoreHiddenPoint,
  229. plotWidth = chart.plotWidth,
  230. plotHeight = chart.plotHeight,
  231. cumulative = 0, // start at top
  232. center = options.center,
  233. centerX = getLength(center[0],
  234. plotWidth),
  235. centerY = getLength(center[1],
  236. plotHeight),
  237. width = getLength(options.width,
  238. plotWidth),
  239. tempWidth,
  240. height = getLength(options.height,
  241. plotHeight),
  242. neckWidth = getLength(options.neckWidth,
  243. plotWidth),
  244. neckHeight = getLength(options.neckHeight,
  245. plotHeight),
  246. neckY = (centerY - height / 2) + height - neckHeight,
  247. data = series.data,
  248. path,
  249. fraction,
  250. half = (options.dataLabels.position === 'left' ?
  251. 1 :
  252. 0),
  253. x1,
  254. y1,
  255. x2,
  256. x3,
  257. y3,
  258. x4,
  259. y5;
  260. /**
  261. * Get positions - either an integer or a percentage string must be
  262. * given.
  263. * @private
  264. * @param {number|string|undefined} length
  265. * Length
  266. * @param {number} relativeTo
  267. * Relative factor
  268. * @return {number}
  269. * Relative position
  270. */
  271. function getLength(length, relativeTo) {
  272. return (/%$/).test(length) ?
  273. relativeTo * parseInt(length, 10) / 100 :
  274. parseInt(length, 10);
  275. }
  276. series.getWidthAt = function (y) {
  277. var top = (centerY - height / 2);
  278. return (y > neckY || height === neckHeight) ?
  279. neckWidth :
  280. neckWidth + (width - neckWidth) *
  281. (1 - (y - top) / (height - neckHeight));
  282. };
  283. series.getX = function (y, half, point) {
  284. return centerX + (half ? -1 : 1) *
  285. ((series.getWidthAt(reversed ? 2 * centerY - y : y) / 2) +
  286. point.labelDistance);
  287. };
  288. // Expose
  289. series.center = [centerX, centerY, height];
  290. series.centerX = centerX;
  291. /*
  292. Individual point coordinate naming:
  293. x1,y1 _________________ x2,y1
  294. \ /
  295. \ /
  296. \ /
  297. \ /
  298. \ /
  299. x3,y3 _________ x4,y3
  300. Additional for the base of the neck:
  301. | |
  302. | |
  303. | |
  304. x3,y5 _________ x4,y5
  305. */
  306. // get the total sum
  307. data.forEach(function (point) {
  308. if (!ignoreHiddenPoint || point.visible !== false) {
  309. sum += point.y;
  310. }
  311. });
  312. data.forEach(function (point) {
  313. // set start and end positions
  314. y5 = null;
  315. fraction = sum ? point.y / sum : 0;
  316. y1 = centerY - height / 2 + cumulative * height;
  317. y3 = y1 + fraction * height;
  318. tempWidth = series.getWidthAt(y1);
  319. x1 = centerX - tempWidth / 2;
  320. x2 = x1 + tempWidth;
  321. tempWidth = series.getWidthAt(y3);
  322. x3 = centerX - tempWidth / 2;
  323. x4 = x3 + tempWidth;
  324. // the entire point is within the neck
  325. if (y1 > neckY) {
  326. x1 = x3 = centerX - neckWidth / 2;
  327. x2 = x4 = centerX + neckWidth / 2;
  328. // the base of the neck
  329. }
  330. else if (y3 > neckY) {
  331. y5 = y3;
  332. tempWidth = series.getWidthAt(neckY);
  333. x3 = centerX - tempWidth / 2;
  334. x4 = x3 + tempWidth;
  335. y3 = neckY;
  336. }
  337. if (reversed) {
  338. y1 = 2 * centerY - y1;
  339. y3 = 2 * centerY - y3;
  340. if (y5 !== null) {
  341. y5 = 2 * centerY - y5;
  342. }
  343. }
  344. // save the path
  345. path = [
  346. ['M', x1, y1],
  347. ['L', x2, y1],
  348. ['L', x4, y3]
  349. ];
  350. if (y5 !== null) {
  351. path.push(['L', x4, y5], ['L', x3, y5]);
  352. }
  353. path.push(['L', x3, y3], ['Z']);
  354. // prepare for using shared dr
  355. point.shapeType = 'path';
  356. point.shapeArgs = { d: path };
  357. // for tooltips and data labels
  358. point.percentage = fraction * 100;
  359. point.plotX = centerX;
  360. point.plotY = (y1 + (y5 || y3)) / 2;
  361. // Placement of tooltips and data labels
  362. point.tooltipPos = [
  363. centerX,
  364. point.plotY
  365. ];
  366. point.dlBox = {
  367. x: x3,
  368. y: y1,
  369. topWidth: x2 - x1,
  370. bottomWidth: x4 - x3,
  371. height: Math.abs(pick(y5, y3) - y1),
  372. width: NaN
  373. };
  374. // Slice is a noop on funnel points
  375. point.slice = noop;
  376. // Mimicking pie data label placement logic
  377. point.half = half;
  378. if (!ignoreHiddenPoint || point.visible !== false) {
  379. cumulative += fraction;
  380. }
  381. });
  382. fireEvent(series, 'afterTranslate');
  383. };
  384. /**
  385. * Funnel items don't have angles (#2289).
  386. * @private
  387. */
  388. FunnelSeries.prototype.sortByAngle = function (points) {
  389. points.sort(function (a, b) {
  390. return a.plotY - b.plotY;
  391. });
  392. };
  393. /**
  394. * Funnel charts are a type of chart often used to visualize stages in a
  395. * sales project, where the top are the initial stages with the most
  396. * clients. It requires that the modules/funnel.js file is loaded.
  397. *
  398. * @sample highcharts/demo/funnel/
  399. * Funnel demo
  400. *
  401. * @extends plotOptions.pie
  402. * @excluding innerSize,size,dataSorting
  403. * @product highcharts
  404. * @requires modules/funnel
  405. * @optionparent plotOptions.funnel
  406. */
  407. FunnelSeries.defaultOptions = merge(PieSeries.defaultOptions, {
  408. /**
  409. * Initial animation is by default disabled for the funnel chart.
  410. */
  411. animation: false,
  412. /**
  413. * The center of the series. By default, it is centered in the middle
  414. * of the plot area, so it fills the plot area height.
  415. *
  416. * @type {Array<number|string>}
  417. * @default ["50%", "50%"]
  418. * @since 3.0
  419. */
  420. center: ['50%', '50%'],
  421. /**
  422. * The width of the funnel compared to the width of the plot area,
  423. * or the pixel width if it is a number.
  424. *
  425. * @type {number|string}
  426. * @since 3.0
  427. */
  428. width: '90%',
  429. /**
  430. * The width of the neck, the lower part of the funnel. A number defines
  431. * pixel width, a percentage string defines a percentage of the plot
  432. * area width.
  433. *
  434. * @sample {highcharts} highcharts/demo/funnel/
  435. * Funnel demo
  436. *
  437. * @type {number|string}
  438. * @since 3.0
  439. */
  440. neckWidth: '30%',
  441. /**
  442. * The height of the funnel or pyramid. If it is a number it defines
  443. * the pixel height, if it is a percentage string it is the percentage
  444. * of the plot area height.
  445. *
  446. * @sample {highcharts} highcharts/demo/funnel/
  447. * Funnel demo
  448. *
  449. * @type {number|string}
  450. * @since 3.0
  451. */
  452. height: '100%',
  453. /**
  454. * The height of the neck, the lower part of the funnel. A number
  455. * defines pixel width, a percentage string defines a percentage of the
  456. * plot area height.
  457. *
  458. * @type {number|string}
  459. */
  460. neckHeight: '25%',
  461. /**
  462. * A reversed funnel has the widest area down. A reversed funnel with
  463. * no neck width and neck height is a pyramid.
  464. *
  465. * @since 3.0.10
  466. */
  467. reversed: false,
  468. /**
  469. * To avoid adapting the data label size in Pie.drawDataLabels.
  470. * @ignore-option
  471. */
  472. size: true,
  473. dataLabels: {
  474. connectorWidth: 1,
  475. verticalAlign: 'middle'
  476. },
  477. /**
  478. * Options for the series states.
  479. */
  480. states: {
  481. /**
  482. * @excluding halo, marker, lineWidth, lineWidthPlus
  483. * @apioption plotOptions.funnel.states.hover
  484. */
  485. /**
  486. * Options for a selected funnel item.
  487. *
  488. * @excluding halo, marker, lineWidth, lineWidthPlus
  489. */
  490. select: {
  491. /**
  492. * A specific color for the selected point.
  493. *
  494. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  495. */
  496. color: palette.neutralColor20,
  497. /**
  498. * A specific border color for the selected point.
  499. *
  500. * @type {Highcharts.ColorString}
  501. */
  502. borderColor: palette.neutralColor100
  503. }
  504. }
  505. });
  506. return FunnelSeries;
  507. }(PieSeries));
  508. extend(FunnelSeries.prototype, {
  509. animate: noop
  510. });
  511. /* *
  512. *
  513. * Hack
  514. *
  515. * */
  516. /* eslint-disable no-invalid-this */
  517. addEvent(Chart, 'afterHideAllOverlappingLabels', function () {
  518. this.series.forEach(function (series) {
  519. var dataLabelsOptions = series.options && series.options.dataLabels;
  520. if (isArray(dataLabelsOptions)) {
  521. dataLabelsOptions = dataLabelsOptions[0];
  522. }
  523. if (series.is('pie') &&
  524. series.placeDataLabels &&
  525. dataLabelsOptions &&
  526. !dataLabelsOptions.inside) {
  527. series.placeDataLabels();
  528. }
  529. });
  530. });
  531. SeriesRegistry.registerSeriesType('funnel', FunnelSeries);
  532. /* *
  533. *
  534. * Default Export
  535. *
  536. * */
  537. /* *
  538. *
  539. * API Options
  540. *
  541. * */
  542. /**
  543. * A `funnel` series. If the [type](#series.funnel.type) option is
  544. * not specified, it is inherited from [chart.type](#chart.type).
  545. *
  546. * @extends series,plotOptions.funnel
  547. * @excluding dataParser, dataURL, stack, xAxis, yAxis, dataSorting,
  548. * boostBlending, boostThreshold
  549. * @product highcharts
  550. * @requires modules/funnel
  551. * @apioption series.funnel
  552. */
  553. /**
  554. * An array of data points for the series. For the `funnel` series type,
  555. * points can be given in the following ways:
  556. *
  557. * 1. An array of numerical values. In this case, the numerical values
  558. * will be interpreted as `y` options. Example:
  559. *
  560. * ```js
  561. * data: [0, 5, 3, 5]
  562. * ```
  563. *
  564. * 2. An array of objects with named values. The following snippet shows only a
  565. * few settings, see the complete options set below. If the total number of data
  566. * points exceeds the series' [turboThreshold](#series.funnel.turboThreshold),
  567. * this option is not available.
  568. *
  569. * ```js
  570. * data: [{
  571. * y: 3,
  572. * name: "Point2",
  573. * color: "#00FF00"
  574. * }, {
  575. * y: 1,
  576. * name: "Point1",
  577. * color: "#FF00FF"
  578. * }]
  579. * ```
  580. *
  581. * @sample {highcharts} highcharts/chart/reflow-true/
  582. * Numerical values
  583. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  584. * Arrays of numeric x and y
  585. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  586. * Arrays of datetime x and y
  587. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  588. * Arrays of point.name and y
  589. * @sample {highcharts} highcharts/series/data-array-of-objects/
  590. * Config objects
  591. *
  592. * @type {Array<number|null|*>}
  593. * @extends series.pie.data
  594. * @excluding sliced
  595. * @product highcharts
  596. * @apioption series.funnel.data
  597. */
  598. ''; // keeps doclets above in transpiled file
  599. return FunnelSeries;
  600. });
  601. _registerModule(_modules, 'Series/Pyramid/PyramidSeries.js', [_modules['Series/Funnel/FunnelSeries.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Utilities.js']], function (FunnelSeries, SeriesRegistry, U) {
  602. /* *
  603. *
  604. * Highcharts funnel module
  605. *
  606. * (c) 2010-2021 Torstein Honsi
  607. *
  608. * License: www.highcharts.com/license
  609. *
  610. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  611. *
  612. * */
  613. var __extends = (this && this.__extends) || (function () {
  614. var extendStatics = function (d,
  615. b) {
  616. extendStatics = Object.setPrototypeOf ||
  617. ({ __proto__: [] } instanceof Array && function (d,
  618. b) { d.__proto__ = b; }) ||
  619. function (d,
  620. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  621. return extendStatics(d, b);
  622. };
  623. return function (d, b) {
  624. extendStatics(d, b);
  625. function __() { this.constructor = d; }
  626. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  627. };
  628. })();
  629. var merge = U.merge;
  630. /* *
  631. *
  632. * Class
  633. *
  634. * */
  635. /**
  636. * Pyramid series type.
  637. *
  638. * @private
  639. * @class
  640. * @name Highcharts.seriesTypes.pyramid
  641. *
  642. * @augments Highcharts.Series
  643. */
  644. var PyramidSeries = /** @class */ (function (_super) {
  645. __extends(PyramidSeries, _super);
  646. function PyramidSeries() {
  647. /* *
  648. *
  649. * Static Properties
  650. *
  651. * */
  652. var _this = _super !== null && _super.apply(this,
  653. arguments) || this;
  654. /* *
  655. *
  656. * Properties
  657. *
  658. * */
  659. _this.data = void 0;
  660. _this.options = void 0;
  661. _this.points = void 0;
  662. return _this;
  663. }
  664. /**
  665. * A pyramid series is a special type of funnel, without neck and reversed
  666. * by default.
  667. *
  668. * @sample highcharts/demo/pyramid/
  669. * Pyramid chart
  670. *
  671. * @extends plotOptions.funnel
  672. * @product highcharts
  673. * @requires modules/funnel
  674. * @optionparent plotOptions.pyramid
  675. */
  676. PyramidSeries.defaultOptions = merge(FunnelSeries.defaultOptions, {
  677. /**
  678. * The pyramid neck width is zero by default, as opposed to the funnel,
  679. * which shares the same layout logic.
  680. *
  681. * @since 3.0.10
  682. */
  683. neckWidth: '0%',
  684. /**
  685. * The pyramid neck width is zero by default, as opposed to the funnel,
  686. * which shares the same layout logic.
  687. *
  688. * @since 3.0.10
  689. */
  690. neckHeight: '0%',
  691. /**
  692. * The pyramid is reversed by default, as opposed to the funnel, which
  693. * shares the layout engine, and is not reversed.
  694. *
  695. * @since 3.0.10
  696. */
  697. reversed: true
  698. });
  699. return PyramidSeries;
  700. }(FunnelSeries));
  701. SeriesRegistry.registerSeriesType('pyramid', PyramidSeries);
  702. /* *
  703. *
  704. * Default Export
  705. *
  706. * */
  707. /* *
  708. *
  709. * API Options
  710. *
  711. * */
  712. /**
  713. * A `pyramid` series. If the [type](#series.pyramid.type) option is
  714. * not specified, it is inherited from [chart.type](#chart.type).
  715. *
  716. * @extends series,plotOptions.pyramid
  717. * @excluding dataParser, dataURL, stack, xAxis, yAxis, dataSorting,
  718. * boostThreshold, boostBlending
  719. * @product highcharts
  720. * @requires modules/funnel
  721. * @apioption series.pyramid
  722. */
  723. /**
  724. * An array of data points for the series. For the `pyramid` series
  725. * type, points can be given in the following ways:
  726. *
  727. * 1. An array of numerical values. In this case, the numerical values will be
  728. * interpreted as `y` options. Example:
  729. * ```js
  730. * data: [0, 5, 3, 5]
  731. * ```
  732. *
  733. * 2. An array of objects with named values. The following snippet shows only a
  734. * few settings, see the complete options set below. If the total number of
  735. * data points exceeds the series'
  736. * [turboThreshold](#series.pyramid.turboThreshold), this option is not
  737. * available.
  738. * ```js
  739. * data: [{
  740. * y: 9,
  741. * name: "Point2",
  742. * color: "#00FF00"
  743. * }, {
  744. * y: 6,
  745. * name: "Point1",
  746. * color: "#FF00FF"
  747. * }]
  748. * ```
  749. *
  750. * @sample {highcharts} highcharts/chart/reflow-true/
  751. * Numerical values
  752. * @sample {highcharts} highcharts/series/data-array-of-objects/
  753. * Config objects
  754. *
  755. * @type {Array<number|null|*>}
  756. * @extends series.pie.data
  757. * @excluding sliced
  758. * @product highcharts
  759. * @apioption series.pyramid.data
  760. */
  761. ''; // adds doclets above into transpiled file
  762. return PyramidSeries;
  763. });
  764. _registerModule(_modules, 'masters/modules/funnel.src.js', [], function () {
  765. });
  766. }));