xrange.src.js 29 KB

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