timeline.src.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. /**
  2. * @license Highcharts JS v8.2.2 (2020-10-22)
  3. *
  4. * Timeline series
  5. *
  6. * (c) 2010-2019 Highsoft AS
  7. * Author: Daniel Studencki
  8. *
  9. * License: www.highcharts.com/license
  10. */
  11. 'use strict';
  12. (function (factory) {
  13. if (typeof module === 'object' && module.exports) {
  14. factory['default'] = factory;
  15. module.exports = factory;
  16. } else if (typeof define === 'function' && define.amd) {
  17. define('highcharts/modules/timeline', ['highcharts'], function (Highcharts) {
  18. factory(Highcharts);
  19. factory.Highcharts = Highcharts;
  20. return factory;
  21. });
  22. } else {
  23. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  24. }
  25. }(function (Highcharts) {
  26. var _modules = Highcharts ? Highcharts._modules : {};
  27. function _registerModule(obj, path, args, fn) {
  28. if (!obj.hasOwnProperty(path)) {
  29. obj[path] = fn.apply(null, args);
  30. }
  31. }
  32. _registerModule(_modules, 'Series/TimelineSeries.js', [_modules['Core/Series/Series.js'], _modules['Core/Globals.js'], _modules['Mixins/LegendSymbol.js'], _modules['Core/Series/Point.js'], _modules['Core/Renderer/SVG/SVGElement.js'], _modules['Core/Utilities.js']], function (BaseSeries, H, LegendSymbolMixin, Point, SVGElement, U) {
  33. /* *
  34. *
  35. * Timeline Series.
  36. *
  37. * (c) 2010-2020 Highsoft AS
  38. *
  39. * Author: Daniel Studencki
  40. *
  41. * License: www.highcharts.com/license
  42. *
  43. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  44. *
  45. * */
  46. var seriesTypes = BaseSeries.seriesTypes;
  47. var addEvent = U.addEvent,
  48. arrayMax = U.arrayMax,
  49. arrayMin = U.arrayMin,
  50. defined = U.defined,
  51. isNumber = U.isNumber,
  52. merge = U.merge,
  53. objectEach = U.objectEach,
  54. pick = U.pick;
  55. var TrackerMixin = H.TrackerMixin,
  56. Series = H.Series;
  57. /**
  58. * Callback JavaScript function to format the data label as a string. Note that
  59. * if a `format` is defined, the format takes precedence and the formatter is
  60. * ignored.
  61. *
  62. * @callback Highcharts.TimelineDataLabelsFormatterCallbackFunction
  63. *
  64. * @param {Highcharts.PointLabelObject|Highcharts.TimelineDataLabelsFormatterContextObject} this
  65. * Data label context to format
  66. *
  67. * @return {number|string|null|undefined}
  68. * Formatted data label text
  69. */
  70. /**
  71. * @interface Highcharts.TimelineDataLabelsFormatterContextObject
  72. * @extends Highcharts.PointLabelObject
  73. */ /**
  74. * @name Highcharts.TimelineDataLabelsFormatterContextObject#key
  75. * @type {string|undefined}
  76. */ /**
  77. * @name Highcharts.TimelineDataLabelsFormatterContextObject#point
  78. * @type {Highcharts.Point}
  79. */ /**
  80. * @name Highcharts.TimelineDataLabelsFormatterContextObject#series
  81. * @type {Highcharts.Series}
  82. */
  83. ''; // dettach doclets above
  84. /**
  85. * The timeline series type.
  86. *
  87. * @private
  88. * @class
  89. * @name Highcharts.seriesTypes.timeline
  90. *
  91. * @augments Highcharts.Series
  92. */
  93. BaseSeries.seriesType('timeline', 'line',
  94. /**
  95. * The timeline series presents given events along a drawn line.
  96. *
  97. * @sample highcharts/series-timeline/alternate-labels
  98. * Timeline series
  99. * @sample highcharts/series-timeline/inverted
  100. * Inverted timeline
  101. * @sample highcharts/series-timeline/datetime-axis
  102. * With true datetime axis
  103. *
  104. * @extends plotOptions.line
  105. * @since 7.0.0
  106. * @product highcharts
  107. * @excluding animationLimit, boostThreshold, connectEnds, connectNulls,
  108. * cropThreshold, dashStyle, findNearestPointBy,
  109. * getExtremesFromAll, lineWidth, negativeColor,
  110. * pointInterval, pointIntervalUnit, pointPlacement,
  111. * pointStart, softThreshold, stacking, step, threshold,
  112. * turboThreshold, zoneAxis, zones, dataSorting,
  113. * boostBlending
  114. * @requires modules/timeline
  115. * @optionparent plotOptions.timeline
  116. */
  117. {
  118. colorByPoint: true,
  119. stickyTracking: false,
  120. ignoreHiddenPoint: true,
  121. legendType: 'point',
  122. lineWidth: 4,
  123. tooltip: {
  124. headerFormat: '<span style="color:{point.color}">\u25CF</span> ' +
  125. '<span style="font-size: 10px"> {point.key}</span><br/>',
  126. pointFormat: '{point.description}'
  127. },
  128. states: {
  129. hover: {
  130. lineWidthPlus: 0
  131. }
  132. },
  133. /**
  134. * @declare Highcharts.TimelineDataLabelsOptionsObject
  135. *
  136. * @private
  137. */
  138. dataLabels: {
  139. enabled: true,
  140. allowOverlap: true,
  141. /**
  142. * Whether to position data labels alternately. For example, if
  143. * [distance](#plotOptions.timeline.dataLabels.distance)
  144. * is set equal to `100`, then data labels will be positioned
  145. * alternately (on both sides of the point) at a distance of 100px.
  146. *
  147. * @sample {highcharts} highcharts/series-timeline/alternate-disabled
  148. * Alternate disabled
  149. */
  150. alternate: true,
  151. backgroundColor: '#ffffff',
  152. borderWidth: 1,
  153. borderColor: '#999999',
  154. borderRadius: 3,
  155. color: '#333333',
  156. /**
  157. * The color of the line connecting the data label to the point.
  158. * The default color is the same as the point's color.
  159. *
  160. * In styled mode, the connector stroke is given in the
  161. * `.highcharts-data-label-connector` class.
  162. *
  163. * @sample {highcharts} highcharts/series-timeline/connector-styles
  164. * Custom connector width and color
  165. *
  166. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  167. * @apioption plotOptions.timeline.dataLabels.connectorColor
  168. */
  169. /**
  170. * The width of the line connecting the data label to the point.
  171. *
  172. * In styled mode, the connector stroke width is given in the
  173. * `.highcharts-data-label-connector` class.
  174. *
  175. * @sample {highcharts} highcharts/series-timeline/connector-styles
  176. * Custom connector width and color
  177. */
  178. connectorWidth: 1,
  179. /**
  180. * A pixel value defining the distance between the data label and
  181. * the point. Negative numbers puts the label on top of the point.
  182. */
  183. distance: 100,
  184. // eslint-disable-next-line valid-jsdoc
  185. /**
  186. * @type {Highcharts.TimelineDataLabelsFormatterCallbackFunction}
  187. * @default function () {
  188. * var format;
  189. *
  190. * if (!this.series.chart.styledMode) {
  191. * format = '<span style="color:' + this.point.color +
  192. * '">● </span>';
  193. * } else {
  194. * format = '<span>● </span>';
  195. * }
  196. * format += '<span>' + (this.key || '') + '</span><br/>' +
  197. * (this.point.label || '');
  198. * return format;
  199. * }
  200. */
  201. formatter: function () {
  202. var format;
  203. if (!this.series.chart.styledMode) {
  204. format = '<span style="color:' + this.point.color +
  205. '">● </span>';
  206. }
  207. else {
  208. format = '<span>● </span>';
  209. }
  210. format += '<span class="highcharts-strong">' +
  211. (this.key || '') + '</span><br/>' +
  212. (this.point.label || '');
  213. return format;
  214. },
  215. style: {
  216. /** @internal */
  217. textOutline: 'none',
  218. /** @internal */
  219. fontWeight: 'normal',
  220. /** @internal */
  221. fontSize: '12px'
  222. },
  223. /**
  224. * Shadow options for the data label.
  225. *
  226. * @type {boolean|Highcharts.CSSObject}
  227. */
  228. shadow: false,
  229. /**
  230. * @type {number}
  231. * @apioption plotOptions.timeline.dataLabels.width
  232. */
  233. verticalAlign: 'middle'
  234. },
  235. marker: {
  236. enabledThreshold: 0,
  237. symbol: 'square',
  238. radius: 6,
  239. lineWidth: 2,
  240. height: 15
  241. },
  242. showInLegend: false,
  243. colorKey: 'x'
  244. },
  245. /**
  246. * @lends Highcharts.Series#
  247. */
  248. {
  249. trackerGroups: ['markerGroup', 'dataLabelsGroup'],
  250. // Use a simple symbol from LegendSymbolMixin
  251. drawLegendSymbol: LegendSymbolMixin.drawRectangle,
  252. // Use a group of trackers from TrackerMixin
  253. drawTracker: TrackerMixin.drawTrackerPoint,
  254. init: function () {
  255. var series = this;
  256. Series.prototype.init.apply(series, arguments);
  257. addEvent(series, 'afterTranslate', function () {
  258. var lastPlotX,
  259. closestPointRangePx = Number.MAX_VALUE;
  260. series.points.forEach(function (point) {
  261. // Set the isInside parameter basing also on the real point
  262. // visibility, in order to avoid showing hidden points
  263. // in drawPoints method.
  264. point.isInside = point.isInside && point.visible;
  265. // New way of calculating closestPointRangePx value, which
  266. // respects the real point visibility is needed.
  267. if (point.visible && !point.isNull) {
  268. if (defined(lastPlotX)) {
  269. closestPointRangePx = Math.min(closestPointRangePx, Math.abs(point.plotX - lastPlotX));
  270. }
  271. lastPlotX = point.plotX;
  272. }
  273. });
  274. series.closestPointRangePx = closestPointRangePx;
  275. });
  276. // Distribute data labels before rendering them. Distribution is
  277. // based on the 'dataLabels.distance' and 'dataLabels.alternate'
  278. // property.
  279. addEvent(series, 'drawDataLabels', function () {
  280. // Distribute data labels basing on defined algorithm.
  281. series.distributeDL(); // @todo use this scope for series
  282. });
  283. addEvent(series, 'afterDrawDataLabels', function () {
  284. var dataLabel; // @todo use this scope for series
  285. // Draw or align connector for each point.
  286. series.points.forEach(function (point) {
  287. dataLabel = point.dataLabel;
  288. if (dataLabel) {
  289. // Within this wrap method is necessary to save the
  290. // current animation params, because the data label
  291. // target position (after animation) is needed to align
  292. // connectors.
  293. dataLabel.animate = function (params) {
  294. if (this.targetPosition) {
  295. this.targetPosition = params;
  296. }
  297. return SVGElement.prototype.animate.apply(this, arguments);
  298. };
  299. // Initialize the targetPosition field within data label
  300. // object. It's necessary because there is need to know
  301. // expected position of specific data label, when
  302. // aligning connectors. This field is overrided inside
  303. // of SVGElement.animate() wrapped method.
  304. if (!dataLabel.targetPosition) {
  305. dataLabel.targetPosition = {};
  306. }
  307. return point.drawConnector();
  308. }
  309. });
  310. });
  311. addEvent(series.chart, 'afterHideOverlappingLabel', function () {
  312. series.points.forEach(function (p) {
  313. if (p.connector &&
  314. p.dataLabel &&
  315. p.dataLabel.oldOpacity !== p.dataLabel.newOpacity) {
  316. p.alignConnector();
  317. }
  318. });
  319. });
  320. },
  321. alignDataLabel: function (point, dataLabel, options, alignTo) {
  322. var series = this,
  323. isInverted = series.chart.inverted,
  324. visiblePoints = series.visibilityMap.filter(function (point) {
  325. return point;
  326. }), visiblePointsCount = series.visiblePointsCount, pointIndex = visiblePoints.indexOf(point), isFirstOrLast = (!pointIndex || pointIndex === visiblePointsCount - 1), dataLabelsOptions = series.options.dataLabels, userDLOptions = point.userDLOptions || {},
  327. // Define multiplier which is used to calculate data label
  328. // width. If data labels are alternate, they have two times more
  329. // space to adapt (excepting first and last ones, which has only
  330. // one and half), than in case of placing all data labels side
  331. // by side.
  332. multiplier = dataLabelsOptions.alternate ?
  333. (isFirstOrLast ? 1.5 : 2) :
  334. 1, distance, availableSpace = Math.floor(series.xAxis.len / visiblePointsCount), pad = dataLabel.padding, targetDLWidth, styles;
  335. // Adjust data label width to the currently available space.
  336. if (point.visible) {
  337. distance = Math.abs(userDLOptions.x || point.options.dataLabels.x);
  338. if (isInverted) {
  339. targetDLWidth = ((distance - pad) * 2 - (point.itemHeight / 2));
  340. styles = {
  341. width: targetDLWidth + 'px',
  342. // Apply ellipsis when data label height is exceeded.
  343. textOverflow: dataLabel.width / targetDLWidth *
  344. dataLabel.height / 2 > availableSpace * multiplier ?
  345. 'ellipsis' : 'none'
  346. };
  347. }
  348. else {
  349. styles = {
  350. width: (userDLOptions.width ||
  351. dataLabelsOptions.width ||
  352. availableSpace * multiplier - (pad * 2)) + 'px'
  353. };
  354. }
  355. dataLabel.css(styles);
  356. if (!series.chart.styledMode) {
  357. dataLabel.shadow(dataLabelsOptions.shadow);
  358. }
  359. }
  360. Series.prototype.alignDataLabel.apply(series, arguments);
  361. },
  362. processData: function () {
  363. var series = this,
  364. visiblePoints = 0,
  365. i;
  366. series.visibilityMap = series.getVisibilityMap();
  367. // Calculate currently visible points.
  368. series.visibilityMap.forEach(function (point) {
  369. if (point) {
  370. visiblePoints++;
  371. }
  372. });
  373. series.visiblePointsCount = visiblePoints;
  374. for (i = 0; i < series.xData.length; i++) {
  375. series.yData[i] = 1;
  376. }
  377. Series.prototype.processData.call(this, arguments);
  378. return;
  379. },
  380. getXExtremes: function (xData) {
  381. var series = this,
  382. filteredData = xData.filter(function (x,
  383. i) {
  384. return series.points[i].isValid() &&
  385. series.points[i].visible;
  386. });
  387. return {
  388. min: arrayMin(filteredData),
  389. max: arrayMax(filteredData)
  390. };
  391. },
  392. generatePoints: function () {
  393. var series = this;
  394. Series.prototype.generatePoints.apply(series);
  395. series.points.forEach(function (point, i) {
  396. point.applyOptions({
  397. x: series.xData[i]
  398. }, series.xData[i]);
  399. });
  400. },
  401. getVisibilityMap: function () {
  402. var series = this,
  403. map = (series.data.length ?
  404. series.data : series.userOptions.data).map(function (point) {
  405. return (point &&
  406. point.visible !== false &&
  407. !point.isNull) ? point : false;
  408. });
  409. return map;
  410. },
  411. distributeDL: function () {
  412. var series = this,
  413. dataLabelsOptions = series.options.dataLabels,
  414. options,
  415. pointDLOptions,
  416. newOptions = {},
  417. visibilityIndex = 1,
  418. distance = dataLabelsOptions.distance;
  419. series.points.forEach(function (point) {
  420. if (point.visible && !point.isNull) {
  421. options = point.options;
  422. pointDLOptions = point.options.dataLabels;
  423. if (!series.hasRendered) {
  424. point.userDLOptions =
  425. merge({}, pointDLOptions);
  426. }
  427. newOptions[series.chart.inverted ? 'x' : 'y'] =
  428. dataLabelsOptions.alternate && visibilityIndex % 2 ?
  429. -distance : distance;
  430. options.dataLabels = merge(newOptions, point.userDLOptions);
  431. visibilityIndex++;
  432. }
  433. });
  434. },
  435. markerAttribs: function (point, state) {
  436. var series = this,
  437. seriesMarkerOptions = series.options.marker,
  438. seriesStateOptions,
  439. pointMarkerOptions = point.marker || {},
  440. symbol = (pointMarkerOptions.symbol || seriesMarkerOptions.symbol),
  441. pointStateOptions,
  442. width = pick(pointMarkerOptions.width,
  443. seriesMarkerOptions.width,
  444. series.closestPointRangePx),
  445. height = pick(pointMarkerOptions.height,
  446. seriesMarkerOptions.height),
  447. radius = 0,
  448. attribs;
  449. // Call default markerAttribs method, when the xAxis type
  450. // is set to datetime.
  451. if (series.xAxis.dateTime) {
  452. return seriesTypes.line.prototype.markerAttribs
  453. .call(this, point, state);
  454. }
  455. // Handle hover and select states
  456. if (state) {
  457. seriesStateOptions =
  458. seriesMarkerOptions.states[state] || {};
  459. pointStateOptions = pointMarkerOptions.states &&
  460. pointMarkerOptions.states[state] || {};
  461. radius = pick(pointStateOptions.radius, seriesStateOptions.radius, radius + (seriesStateOptions.radiusPlus || 0));
  462. }
  463. point.hasImage = (symbol && symbol.indexOf('url') === 0);
  464. attribs = {
  465. x: Math.floor(point.plotX) - (width / 2) - (radius / 2),
  466. y: point.plotY - (height / 2) - (radius / 2),
  467. width: width + radius,
  468. height: height + radius
  469. };
  470. return attribs;
  471. },
  472. bindAxes: function () {
  473. var series = this;
  474. Series.prototype.bindAxes.call(series);
  475. ['xAxis', 'yAxis'].forEach(function (axis) {
  476. // Initially set the linked xAxis type to category.
  477. if (axis === 'xAxis' && !series[axis].userOptions.type) {
  478. series[axis].categories = series[axis].hasNames = true;
  479. }
  480. });
  481. }
  482. },
  483. /**
  484. * @lends Highcharts.Point#
  485. */
  486. {
  487. init: function () {
  488. var point = Point.prototype.init.apply(this,
  489. arguments);
  490. point.name = pick(point.name, 'Event');
  491. point.y = 1;
  492. return point;
  493. },
  494. isValid: function () {
  495. return this.options.y !== null;
  496. },
  497. setVisible: function (vis, redraw) {
  498. var point = this,
  499. series = point.series;
  500. redraw = pick(redraw, series.options.ignoreHiddenPoint);
  501. seriesTypes.pie.prototype.pointClass.prototype
  502. .setVisible.call(point, vis, false);
  503. // Process new data
  504. series.processData();
  505. if (redraw) {
  506. series.chart.redraw();
  507. }
  508. },
  509. setState: function () {
  510. var proceed = Series.prototype.pointClass.prototype.setState;
  511. // Prevent triggering the setState method on null points.
  512. if (!this.isNull) {
  513. proceed.apply(this, arguments);
  514. }
  515. },
  516. getConnectorPath: function () {
  517. var point = this,
  518. chart = point.series.chart,
  519. xAxisLen = point.series.xAxis.len,
  520. inverted = chart.inverted,
  521. direction = inverted ? 'x2' : 'y2',
  522. dl = point.dataLabel,
  523. targetDLPos = dl.targetPosition,
  524. coords = {
  525. x1: point.plotX,
  526. y1: point.plotY,
  527. x2: point.plotX,
  528. y2: isNumber(targetDLPos.y) ? targetDLPos.y : dl.y
  529. },
  530. negativeDistance = ((dl.alignAttr || dl)[direction[0]] <
  531. point.series.yAxis.len / 2),
  532. path;
  533. // Recalculate coords when the chart is inverted.
  534. if (inverted) {
  535. coords = {
  536. x1: point.plotY,
  537. y1: xAxisLen - point.plotX,
  538. x2: targetDLPos.x || dl.x,
  539. y2: xAxisLen - point.plotX
  540. };
  541. }
  542. // Subtract data label width or height from expected coordinate so
  543. // that the connector would start from the appropriate edge.
  544. if (negativeDistance) {
  545. coords[direction] += dl[inverted ? 'width' : 'height'];
  546. }
  547. // Change coordinates so that they will be relative to data label.
  548. objectEach(coords, function (_coord, i) {
  549. coords[i] -= (dl.alignAttr || dl)[i[0]];
  550. });
  551. path = chart.renderer.crispLine([
  552. ['M', coords.x1, coords.y1],
  553. ['L', coords.x2, coords.y2]
  554. ], dl.options.connectorWidth);
  555. return path;
  556. },
  557. drawConnector: function () {
  558. var point = this,
  559. series = point.series;
  560. if (!point.connector) {
  561. point.connector = series.chart.renderer
  562. .path(point.getConnectorPath())
  563. .attr({
  564. zIndex: -1
  565. })
  566. .add(point.dataLabel);
  567. }
  568. if (point.series.chart.isInsidePlot(// #10507
  569. point.dataLabel.x, point.dataLabel.y)) {
  570. point.alignConnector();
  571. }
  572. },
  573. alignConnector: function () {
  574. var point = this,
  575. series = point.series,
  576. connector = point.connector,
  577. dl = point.dataLabel,
  578. dlOptions = point.dataLabel.options = merge(series.options.dataLabels,
  579. point.options.dataLabels),
  580. chart = point.series.chart,
  581. bBox = connector.getBBox(),
  582. plotPos = {
  583. x: bBox.x + dl.translateX,
  584. y: bBox.y + dl.translateY
  585. },
  586. isVisible;
  587. // Include a half of connector width in order to run animation,
  588. // when connectors are aligned to the plot area edge.
  589. if (chart.inverted) {
  590. plotPos.y -= dl.options.connectorWidth / 2;
  591. }
  592. else {
  593. plotPos.x += dl.options.connectorWidth / 2;
  594. }
  595. isVisible = chart.isInsidePlot(plotPos.x, plotPos.y);
  596. connector[isVisible ? 'animate' : 'attr']({
  597. d: point.getConnectorPath()
  598. });
  599. if (!series.chart.styledMode) {
  600. connector.attr({
  601. stroke: dlOptions.connectorColor || point.color,
  602. 'stroke-width': dlOptions.connectorWidth,
  603. opacity: dl[defined(dl.newOpacity) ? 'newOpacity' : 'opacity']
  604. });
  605. }
  606. }
  607. });
  608. /**
  609. * The `timeline` series. If the [type](#series.timeline.type) option is
  610. * not specified, it is inherited from [chart.type](#chart.type).
  611. *
  612. * @extends series,plotOptions.timeline
  613. * @excluding animationLimit, boostThreshold, connectEnds, connectNulls,
  614. * cropThreshold, dashStyle, dataParser, dataURL, findNearestPointBy,
  615. * getExtremesFromAll, lineWidth, negativeColor,
  616. * pointInterval, pointIntervalUnit, pointPlacement, pointStart,
  617. * softThreshold, stacking, stack, step, threshold, turboThreshold,
  618. * zoneAxis, zones, dataSorting, boostBlending
  619. * @product highcharts
  620. * @requires modules/timeline
  621. * @apioption series.timeline
  622. */
  623. /**
  624. * An array of data points for the series. For the `timeline` series type,
  625. * points can be given with three general parameters, `name`, `label`,
  626. * and `description`:
  627. *
  628. * Example:
  629. *
  630. * ```js
  631. * series: [{
  632. * type: 'timeline',
  633. * data: [{
  634. * name: 'Jan 2018',
  635. * label: 'Some event label',
  636. * description: 'Description to show in tooltip'
  637. * }]
  638. * }]
  639. * ```
  640. * If all points additionally have the `x` values, and xAxis type is set to
  641. * `datetime`, then events are laid out on a true time axis, where their
  642. * placement reflects the actual time between them.
  643. *
  644. * @sample {highcharts} highcharts/series-timeline/alternate-labels
  645. * Alternate labels
  646. * @sample {highcharts} highcharts/series-timeline/datetime-axis
  647. * Real time intervals
  648. *
  649. * @type {Array<*>}
  650. * @extends series.line.data
  651. * @excluding marker, y
  652. * @product highcharts
  653. * @apioption series.timeline.data
  654. */
  655. /**
  656. * The name of event.
  657. *
  658. * @type {string}
  659. * @product highcharts
  660. * @apioption series.timeline.data.name
  661. */
  662. /**
  663. * The label of event.
  664. *
  665. * @type {string}
  666. * @product highcharts
  667. * @apioption series.timeline.data.label
  668. */
  669. /**
  670. * The description of event. This description will be shown in tooltip.
  671. *
  672. * @type {string}
  673. * @product highcharts
  674. * @apioption series.timeline.data.description
  675. */
  676. ''; // adds doclets above to transpiled file
  677. });
  678. _registerModule(_modules, 'masters/modules/timeline.src.js', [], function () {
  679. });
  680. }));