xrange.src.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. /**
  2. * @license Highcharts JS v8.2.0 (2020-08-20)
  3. *
  4. * X-range series
  5. *
  6. * (c) 2010-2019 Torstein Honsi, Lars A. V. Cabrera
  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/xrange', ['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/XRangeSeries.js', [_modules['Core/Axis/Axis.js'], _modules['Core/Globals.js'], _modules['Core/Color.js'], _modules['Core/Series/Point.js'], _modules['Core/Utilities.js']], function (Axis, H, Color, Point, U) {
  32. /* *
  33. *
  34. * X-range series module
  35. *
  36. * (c) 2010-2020 Torstein Honsi, Lars A. V. Cabrera
  37. *
  38. * License: www.highcharts.com/license
  39. *
  40. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  41. *
  42. * */
  43. var color = Color.parse;
  44. var addEvent = U.addEvent,
  45. clamp = U.clamp,
  46. correctFloat = U.correctFloat,
  47. defined = U.defined,
  48. find = U.find,
  49. isNumber = U.isNumber,
  50. isObject = U.isObject,
  51. merge = U.merge,
  52. pick = U.pick,
  53. seriesType = U.seriesType;
  54. /* *
  55. * @interface Highcharts.PointOptionsObject in parts/Point.ts
  56. */ /**
  57. * The ending X value of the range point.
  58. * @name Highcharts.PointOptionsObject#x2
  59. * @type {number|undefined}
  60. * @requires modules/xrange
  61. */
  62. var columnType = H.seriesTypes.column,
  63. seriesTypes = H.seriesTypes,
  64. Series = H.Series;
  65. /**
  66. * Return color of a point based on its category.
  67. *
  68. * @private
  69. * @function getColorByCategory
  70. *
  71. * @param {object} series
  72. * The series which the point belongs to.
  73. *
  74. * @param {object} point
  75. * The point to calculate its color for.
  76. *
  77. * @return {object}
  78. * Returns an object containing the properties color and colorIndex.
  79. */
  80. function getColorByCategory(series, point) {
  81. var colors = series.options.colors || series.chart.options.colors,
  82. colorCount = colors ?
  83. colors.length :
  84. series.chart.options.chart.colorCount,
  85. colorIndex = point.y % colorCount,
  86. color = colors && colors[colorIndex];
  87. return {
  88. colorIndex: colorIndex,
  89. color: color
  90. };
  91. }
  92. /**
  93. * @private
  94. * @class
  95. * @name Highcharts.seriesTypes.xrange
  96. *
  97. * @augments Highcharts.Series
  98. */
  99. seriesType('xrange', 'column'
  100. /**
  101. * The X-range series displays ranges on the X axis, typically time
  102. * intervals with a start and end date.
  103. *
  104. * @sample {highcharts} highcharts/demo/x-range/
  105. * X-range
  106. * @sample {highcharts} highcharts/css/x-range/
  107. * Styled mode X-range
  108. * @sample {highcharts} highcharts/chart/inverted-xrange/
  109. * Inverted X-range
  110. *
  111. * @extends plotOptions.column
  112. * @since 6.0.0
  113. * @product highcharts highstock gantt
  114. * @excluding boostThreshold, crisp, cropThreshold, depth, edgeColor,
  115. * edgeWidth, findNearestPointBy, getExtremesFromAll,
  116. * negativeColor, pointInterval, pointIntervalUnit,
  117. * pointPlacement, pointRange, pointStart, softThreshold,
  118. * stacking, threshold, data, dataSorting, boostBlending
  119. * @requires modules/xrange
  120. * @optionparent plotOptions.xrange
  121. */
  122. , {
  123. /**
  124. * A partial fill for each point, typically used to visualize how much
  125. * of a task is performed. The partial fill object can be set either on
  126. * series or point level.
  127. *
  128. * @sample {highcharts} highcharts/demo/x-range
  129. * X-range with partial fill
  130. *
  131. * @product highcharts highstock gantt
  132. * @apioption plotOptions.xrange.partialFill
  133. */
  134. /**
  135. * The fill color to be used for partial fills. Defaults to a darker
  136. * shade of the point color.
  137. *
  138. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  139. * @product highcharts highstock gantt
  140. * @apioption plotOptions.xrange.partialFill.fill
  141. */
  142. /**
  143. * A partial fill for each point, typically used to visualize how much
  144. * of a task is performed. See [completed](series.gantt.data.completed).
  145. *
  146. * @sample gantt/demo/progress-indicator
  147. * Gantt with progress indicator
  148. *
  149. * @product gantt
  150. * @apioption plotOptions.gantt.partialFill
  151. */
  152. /**
  153. * In an X-range series, this option makes all points of the same Y-axis
  154. * category the same color.
  155. */
  156. colorByPoint: true,
  157. dataLabels: {
  158. formatter: function () {
  159. var point = this.point,
  160. amount = point.partialFill;
  161. if (isObject(amount)) {
  162. amount = amount.amount;
  163. }
  164. if (isNumber(amount) && amount > 0) {
  165. return correctFloat(amount * 100) + '%';
  166. }
  167. },
  168. inside: true,
  169. verticalAlign: 'middle'
  170. },
  171. tooltip: {
  172. headerFormat: '<span style="font-size: 10px">{point.x} - {point.x2}</span><br/>',
  173. pointFormat: '<span style="color:{point.color}">\u25CF</span> {series.name}: <b>{point.yCategory}</b><br/>'
  174. },
  175. borderRadius: 3,
  176. pointRange: 0
  177. }, {
  178. type: 'xrange',
  179. parallelArrays: ['x', 'x2', 'y'],
  180. requireSorting: false,
  181. animate: seriesTypes.line.prototype.animate,
  182. cropShoulder: 1,
  183. getExtremesFromAll: true,
  184. autoIncrement: H.noop,
  185. buildKDTree: H.noop,
  186. /* eslint-disable valid-jsdoc */
  187. /**
  188. * @private
  189. * @function Highcarts.seriesTypes.xrange#init
  190. * @return {void}
  191. */
  192. init: function () {
  193. seriesTypes.column.prototype.init.apply(this, arguments);
  194. this.options.stacking = void 0; // #13161
  195. },
  196. /**
  197. * Borrow the column series metrics, but with swapped axes. This gives
  198. * free access to features like groupPadding, grouping, pointWidth etc.
  199. *
  200. * @private
  201. * @function Highcharts.Series#getColumnMetrics
  202. *
  203. * @return {Highcharts.ColumnMetricsObject}
  204. */
  205. getColumnMetrics: function () {
  206. var metrics,
  207. chart = this.chart;
  208. /**
  209. * @private
  210. */
  211. function swapAxes() {
  212. chart.series.forEach(function (s) {
  213. var xAxis = s.xAxis;
  214. s.xAxis = s.yAxis;
  215. s.yAxis = xAxis;
  216. });
  217. }
  218. swapAxes();
  219. metrics = columnType.prototype.getColumnMetrics.call(this);
  220. swapAxes();
  221. return metrics;
  222. },
  223. /**
  224. * Override cropData to show a point where x or x2 is outside visible
  225. * range, but one of them is inside.
  226. *
  227. * @private
  228. * @function Highcharts.Series#cropData
  229. *
  230. * @param {Array<number>} xData
  231. *
  232. * @param {Array<number>} yData
  233. *
  234. * @param {number} min
  235. *
  236. * @param {number} max
  237. *
  238. * @param {number} [cropShoulder]
  239. *
  240. * @return {*}
  241. */
  242. cropData: function (xData, yData, min, max) {
  243. // Replace xData with x2Data to find the appropriate cropStart
  244. var cropData = Series.prototype.cropData,
  245. crop = cropData.call(this,
  246. this.x2Data,
  247. yData,
  248. min,
  249. max);
  250. // Re-insert the cropped xData
  251. crop.xData = xData.slice(crop.start, crop.end);
  252. return crop;
  253. },
  254. /**
  255. * Finds the index of an existing point that matches the given point
  256. * options.
  257. *
  258. * @private
  259. * @function Highcharts.Series#findPointIndex
  260. * @param {object} options The options of the point.
  261. * @returns {number|undefined} Returns index of a matching point,
  262. * returns undefined if no match is found.
  263. */
  264. findPointIndex: function (options) {
  265. var _a = this,
  266. cropped = _a.cropped,
  267. cropStart = _a.cropStart,
  268. points = _a.points;
  269. var id = options.id;
  270. var pointIndex;
  271. if (id) {
  272. var point = find(points,
  273. function (point) {
  274. return point.id === id;
  275. });
  276. pointIndex = point ? point.index : void 0;
  277. }
  278. if (typeof pointIndex === 'undefined') {
  279. var point = find(points,
  280. function (point) {
  281. return (point.x === options.x &&
  282. point.x2 === options.x2 &&
  283. !point.touched);
  284. });
  285. pointIndex = point ? point.index : void 0;
  286. }
  287. // Reduce pointIndex if data is cropped
  288. if (cropped &&
  289. isNumber(pointIndex) &&
  290. isNumber(cropStart) &&
  291. pointIndex >= cropStart) {
  292. pointIndex -= cropStart;
  293. }
  294. return pointIndex;
  295. },
  296. /**
  297. * @private
  298. * @function Highcharts.Series#translatePoint
  299. *
  300. * @param {Highcharts.Point} point
  301. */
  302. translatePoint: function (point) {
  303. var series = this,
  304. xAxis = series.xAxis,
  305. yAxis = series.yAxis,
  306. metrics = series.columnMetrics,
  307. options = series.options,
  308. minPointLength = options.minPointLength || 0,
  309. plotX = point.plotX,
  310. posX = pick(point.x2,
  311. point.x + (point.len || 0)),
  312. plotX2 = xAxis.translate(posX, 0, 0, 0, 1),
  313. length = Math.abs(plotX2 - plotX),
  314. widthDifference,
  315. shapeArgs,
  316. partialFill,
  317. inverted = this.chart.inverted,
  318. borderWidth = pick(options.borderWidth, 1),
  319. crisper = borderWidth % 2 / 2,
  320. yOffset = metrics.offset,
  321. pointHeight = Math.round(metrics.width),
  322. dlLeft,
  323. dlRight,
  324. dlWidth,
  325. clipRectWidth,
  326. tooltipYOffset;
  327. if (minPointLength) {
  328. widthDifference = minPointLength - length;
  329. if (widthDifference < 0) {
  330. widthDifference = 0;
  331. }
  332. plotX -= widthDifference / 2;
  333. plotX2 += widthDifference / 2;
  334. }
  335. plotX = Math.max(plotX, -10);
  336. plotX2 = clamp(plotX2, -10, xAxis.len + 10);
  337. // Handle individual pointWidth
  338. if (defined(point.options.pointWidth)) {
  339. yOffset -= ((Math.ceil(point.options.pointWidth) - pointHeight) / 2);
  340. pointHeight = Math.ceil(point.options.pointWidth);
  341. }
  342. // Apply pointPlacement to the Y axis
  343. if (options.pointPlacement &&
  344. isNumber(point.plotY) &&
  345. yAxis.categories) {
  346. point.plotY = yAxis.translate(point.y, 0, 1, 0, 1, options.pointPlacement);
  347. }
  348. point.shapeArgs = {
  349. x: Math.floor(Math.min(plotX, plotX2)) + crisper,
  350. y: Math.floor(point.plotY + yOffset) + crisper,
  351. width: Math.round(Math.abs(plotX2 - plotX)),
  352. height: pointHeight,
  353. r: series.options.borderRadius
  354. };
  355. // Align data labels inside the shape and inside the plot area
  356. dlLeft = point.shapeArgs.x;
  357. dlRight = dlLeft + point.shapeArgs.width;
  358. if (dlLeft < 0 || dlRight > xAxis.len) {
  359. dlLeft = clamp(dlLeft, 0, xAxis.len);
  360. dlRight = clamp(dlRight, 0, xAxis.len);
  361. dlWidth = dlRight - dlLeft;
  362. point.dlBox = merge(point.shapeArgs, {
  363. x: dlLeft,
  364. width: dlRight - dlLeft,
  365. centerX: dlWidth ? dlWidth / 2 : null
  366. });
  367. }
  368. else {
  369. point.dlBox = null;
  370. }
  371. // Tooltip position
  372. var tooltipPos = point.tooltipPos;
  373. var xIndex = !inverted ? 0 : 1;
  374. var yIndex = !inverted ? 1 : 0;
  375. tooltipYOffset = series.columnMetrics ?
  376. series.columnMetrics.offset : -metrics.width / 2;
  377. // Limit position by the correct axis size (#9727)
  378. tooltipPos[xIndex] = clamp(tooltipPos[xIndex] + ((!inverted ? 1 : -1) * (xAxis.reversed ? -1 : 1) *
  379. (length / 2)), 0, xAxis.len - 1);
  380. tooltipPos[yIndex] = clamp(tooltipPos[yIndex] + ((inverted ? -1 : 1) * tooltipYOffset), 0, yAxis.len - 1);
  381. // Add a partShapeArgs to the point, based on the shapeArgs property
  382. partialFill = point.partialFill;
  383. if (partialFill) {
  384. // Get the partial fill amount
  385. if (isObject(partialFill)) {
  386. partialFill = partialFill.amount;
  387. }
  388. // If it was not a number, assume 0
  389. if (!isNumber(partialFill)) {
  390. partialFill = 0;
  391. }
  392. shapeArgs = point.shapeArgs;
  393. point.partShapeArgs = {
  394. x: shapeArgs.x,
  395. y: shapeArgs.y,
  396. width: shapeArgs.width,
  397. height: shapeArgs.height,
  398. r: series.options.borderRadius
  399. };
  400. clipRectWidth = Math.max(Math.round(length * partialFill + point.plotX -
  401. plotX), 0);
  402. point.clipRectArgs = {
  403. x: xAxis.reversed ? // #10717
  404. shapeArgs.x + length - clipRectWidth :
  405. shapeArgs.x,
  406. y: shapeArgs.y,
  407. width: clipRectWidth,
  408. height: shapeArgs.height
  409. };
  410. }
  411. },
  412. /**
  413. * @private
  414. * @function Highcharts.Series#translate
  415. */
  416. translate: function () {
  417. columnType.prototype.translate.apply(this, arguments);
  418. this.points.forEach(function (point) {
  419. this.translatePoint(point);
  420. }, this);
  421. },
  422. /**
  423. * Draws a single point in the series. Needed for partial fill.
  424. *
  425. * This override turns point.graphic into a group containing the
  426. * original graphic and an overlay displaying the partial fill.
  427. *
  428. * @private
  429. * @function Highcharts.Series#drawPoint
  430. *
  431. * @param {Highcharts.Point} point
  432. * An instance of Point in the series.
  433. *
  434. * @param {"animate"|"attr"} verb
  435. * 'animate' (animates changes) or 'attr' (sets options)
  436. */
  437. drawPoint: function (point, verb) {
  438. var series = this,
  439. seriesOpts = series.options,
  440. renderer = series.chart.renderer,
  441. graphic = point.graphic,
  442. type = point.shapeType,
  443. shapeArgs = point.shapeArgs,
  444. partShapeArgs = point.partShapeArgs,
  445. clipRectArgs = point.clipRectArgs,
  446. pfOptions = point.partialFill,
  447. cutOff = seriesOpts.stacking && !seriesOpts.borderRadius,
  448. pointState = point.state,
  449. stateOpts = (seriesOpts.states[pointState || 'normal'] ||
  450. {}),
  451. pointStateVerb = typeof pointState === 'undefined' ?
  452. 'attr' : verb,
  453. pointAttr = series.pointAttribs(point,
  454. pointState),
  455. animation = pick(series.chart.options.chart.animation,
  456. stateOpts.animation),
  457. fill;
  458. if (!point.isNull && point.visible !== false) {
  459. // Original graphic
  460. if (graphic) { // update
  461. graphic.rect[verb](shapeArgs);
  462. }
  463. else {
  464. point.graphic = graphic = renderer.g('point')
  465. .addClass(point.getClassName())
  466. .add(point.group || series.group);
  467. graphic.rect = renderer[type](merge(shapeArgs))
  468. .addClass(point.getClassName())
  469. .addClass('highcharts-partfill-original')
  470. .add(graphic);
  471. }
  472. // Partial fill graphic
  473. if (partShapeArgs) {
  474. if (graphic.partRect) {
  475. graphic.partRect[verb](merge(partShapeArgs));
  476. graphic.partialClipRect[verb](merge(clipRectArgs));
  477. }
  478. else {
  479. graphic.partialClipRect = renderer.clipRect(clipRectArgs.x, clipRectArgs.y, clipRectArgs.width, clipRectArgs.height);
  480. graphic.partRect =
  481. renderer[type](partShapeArgs)
  482. .addClass('highcharts-partfill-overlay')
  483. .add(graphic)
  484. .clip(graphic.partialClipRect);
  485. }
  486. }
  487. // Presentational
  488. if (!series.chart.styledMode) {
  489. graphic
  490. .rect[verb](pointAttr, animation)
  491. .shadow(seriesOpts.shadow, null, cutOff);
  492. if (partShapeArgs) {
  493. // Ensure pfOptions is an object
  494. if (!isObject(pfOptions)) {
  495. pfOptions = {};
  496. }
  497. if (isObject(seriesOpts.partialFill)) {
  498. pfOptions = merge(pfOptions, seriesOpts.partialFill);
  499. }
  500. fill = (pfOptions.fill ||
  501. color(pointAttr.fill).brighten(-0.3).get() ||
  502. color(point.color || series.color)
  503. .brighten(-0.3).get());
  504. pointAttr.fill = fill;
  505. graphic
  506. .partRect[pointStateVerb](pointAttr, animation)
  507. .shadow(seriesOpts.shadow, null, cutOff);
  508. }
  509. }
  510. }
  511. else if (graphic) {
  512. point.graphic = graphic.destroy(); // #1269
  513. }
  514. },
  515. /**
  516. * @private
  517. * @function Highcharts.Series#drawPoints
  518. */
  519. drawPoints: function () {
  520. var series = this,
  521. verb = series.getAnimationVerb();
  522. // Draw the columns
  523. series.points.forEach(function (point) {
  524. series.drawPoint(point, verb);
  525. });
  526. },
  527. /**
  528. * Returns "animate", or "attr" if the number of points is above the
  529. * animation limit.
  530. *
  531. * @private
  532. * @function Highcharts.Series#getAnimationVerb
  533. *
  534. * @return {string}
  535. */
  536. getAnimationVerb: function () {
  537. return (this.chart.pointCount < (this.options.animationLimit || 250) ?
  538. 'animate' :
  539. 'attr');
  540. }
  541. /*
  542. // Override to remove stroke from points. For partial fill.
  543. pointAttribs: function () {
  544. var series = this,
  545. retVal = columnType.prototype.pointAttribs
  546. .apply(series,
  547. arguments);
  548. //retVal['stroke-width'] = 0;
  549. return retVal;
  550. }
  551. //*/
  552. /* eslint-enable valid-jsdoc */
  553. }, {
  554. /**
  555. * The ending X value of the range point.
  556. * @name Highcharts.Point#x2
  557. * @type {number|undefined}
  558. * @requires modules/xrange
  559. */
  560. /**
  561. * Extend applyOptions so that `colorByPoint` for x-range means that one
  562. * color is applied per Y axis category.
  563. *
  564. * @private
  565. * @function Highcharts.Point#applyOptions
  566. *
  567. * @return {Highcharts.Series}
  568. */
  569. /* eslint-disable valid-jsdoc */
  570. /**
  571. * @private
  572. */
  573. resolveColor: function () {
  574. var series = this.series,
  575. colorByPoint;
  576. if (series.options.colorByPoint && !this.options.color) {
  577. colorByPoint = getColorByCategory(series, this);
  578. if (!series.chart.styledMode) {
  579. this.color = colorByPoint.color;
  580. }
  581. if (!this.options.colorIndex) {
  582. this.colorIndex = colorByPoint.colorIndex;
  583. }
  584. }
  585. else if (!this.color) {
  586. this.color = series.color;
  587. }
  588. },
  589. /**
  590. * Extend init to have y default to 0.
  591. *
  592. * @private
  593. * @function Highcharts.Point#init
  594. *
  595. * @return {Highcharts.Point}
  596. */
  597. init: function () {
  598. Point.prototype.init.apply(this, arguments);
  599. if (!this.y) {
  600. this.y = 0;
  601. }
  602. return this;
  603. },
  604. /**
  605. * @private
  606. * @function Highcharts.Point#setState
  607. */
  608. setState: function () {
  609. Point.prototype.setState.apply(this, arguments);
  610. this.series.drawPoint(this, this.series.getAnimationVerb());
  611. },
  612. /**
  613. * @private
  614. * @function Highcharts.Point#getLabelConfig
  615. *
  616. * @return {Highcharts.PointLabelObject}
  617. */
  618. // Add x2 and yCategory to the available properties for tooltip formats
  619. getLabelConfig: function () {
  620. var point = this,
  621. cfg = Point.prototype.getLabelConfig.call(point),
  622. yCats = point.series.yAxis.categories;
  623. cfg.x2 = point.x2;
  624. cfg.yCategory = point.yCategory = yCats && yCats[point.y];
  625. return cfg;
  626. },
  627. tooltipDateKeys: ['x', 'x2'],
  628. /**
  629. * @private
  630. * @function Highcharts.Point#isValid
  631. *
  632. * @return {boolean}
  633. */
  634. isValid: function () {
  635. return typeof this.x === 'number' &&
  636. typeof this.x2 === 'number';
  637. }
  638. /* eslint-enable valid-jsdoc */
  639. });
  640. /**
  641. * Max x2 should be considered in xAxis extremes
  642. */
  643. addEvent(Axis, 'afterGetSeriesExtremes', function () {
  644. var axis = this, // eslint-disable-line no-invalid-this
  645. axisSeries = axis.series,
  646. dataMax,
  647. modMax;
  648. if (axis.isXAxis) {
  649. dataMax = pick(axis.dataMax, -Number.MAX_VALUE);
  650. axisSeries.forEach(function (series) {
  651. if (series.x2Data) {
  652. series.x2Data
  653. .forEach(function (val) {
  654. if (val > dataMax) {
  655. dataMax = val;
  656. modMax = true;
  657. }
  658. });
  659. }
  660. });
  661. if (modMax) {
  662. axis.dataMax = dataMax;
  663. }
  664. }
  665. });
  666. /**
  667. * An `xrange` series. If the [type](#series.xrange.type) option is not
  668. * specified, it is inherited from [chart.type](#chart.type).
  669. *
  670. * @extends series,plotOptions.xrange
  671. * @excluding boostThreshold, crisp, cropThreshold, depth, edgeColor, edgeWidth,
  672. * findNearestPointBy, getExtremesFromAll, negativeColor,
  673. * pointInterval, pointIntervalUnit, pointPlacement, pointRange,
  674. * pointStart, softThreshold, stacking, threshold, dataSorting,
  675. * boostBlending
  676. * @product highcharts highstock gantt
  677. * @requires modules/xrange
  678. * @apioption series.xrange
  679. */
  680. /**
  681. * An array of data points for the series. For the `xrange` series type,
  682. * points can be given in the following ways:
  683. *
  684. * 1. An array of objects with named values. The objects are point configuration
  685. * objects as seen below.
  686. * ```js
  687. * data: [{
  688. * x: Date.UTC(2017, 0, 1),
  689. * x2: Date.UTC(2017, 0, 3),
  690. * name: "Test",
  691. * y: 0,
  692. * color: "#00FF00"
  693. * }, {
  694. * x: Date.UTC(2017, 0, 4),
  695. * x2: Date.UTC(2017, 0, 5),
  696. * name: "Deploy",
  697. * y: 1,
  698. * color: "#FF0000"
  699. * }]
  700. * ```
  701. *
  702. * @sample {highcharts} highcharts/series/data-array-of-objects/
  703. * Config objects
  704. *
  705. * @declare Highcharts.XrangePointOptionsObject
  706. * @type {Array<*>}
  707. * @extends series.line.data
  708. * @product highcharts highstock gantt
  709. * @apioption series.xrange.data
  710. */
  711. /**
  712. * The starting X value of the range point.
  713. *
  714. * @sample {highcharts} highcharts/demo/x-range
  715. * X-range
  716. *
  717. * @type {number}
  718. * @product highcharts highstock gantt
  719. * @apioption series.xrange.data.x
  720. */
  721. /**
  722. * The ending X value of the range point.
  723. *
  724. * @sample {highcharts} highcharts/demo/x-range
  725. * X-range
  726. *
  727. * @type {number}
  728. * @product highcharts highstock gantt
  729. * @apioption series.xrange.data.x2
  730. */
  731. /**
  732. * The Y value of the range point.
  733. *
  734. * @sample {highcharts} highcharts/demo/x-range
  735. * X-range
  736. *
  737. * @type {number}
  738. * @product highcharts highstock gantt
  739. * @apioption series.xrange.data.y
  740. */
  741. /**
  742. * A partial fill for each point, typically used to visualize how much of
  743. * a task is performed. The partial fill object can be set either on series
  744. * or point level.
  745. *
  746. * @sample {highcharts} highcharts/demo/x-range
  747. * X-range with partial fill
  748. *
  749. * @declare Highcharts.XrangePointPartialFillOptionsObject
  750. * @product highcharts highstock gantt
  751. * @apioption series.xrange.data.partialFill
  752. */
  753. /**
  754. * The amount of the X-range point to be filled. Values can be 0-1 and are
  755. * converted to percentages in the default data label formatter.
  756. *
  757. * @type {number}
  758. * @product highcharts highstock gantt
  759. * @apioption series.xrange.data.partialFill.amount
  760. */
  761. /**
  762. * The fill color to be used for partial fills. Defaults to a darker shade
  763. * of the point color.
  764. *
  765. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  766. * @product highcharts highstock gantt
  767. * @apioption series.xrange.data.partialFill.fill
  768. */
  769. ''; // adds doclets above to transpiled file
  770. });
  771. _registerModule(_modules, 'masters/modules/xrange.src.js', [], function () {
  772. });
  773. }));