xrange.src.js 31 KB

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