timeline.src.js 29 KB

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