dumbbell.src.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. /**
  2. * @license Highcharts JS v9.0.1 (2021-02-16)
  3. *
  4. * (c) 2009-2021 Sebastian Bochan, Rafal Sebestjanski
  5. *
  6. * License: www.highcharts.com/license
  7. */
  8. 'use strict';
  9. (function (factory) {
  10. if (typeof module === 'object' && module.exports) {
  11. factory['default'] = factory;
  12. module.exports = factory;
  13. } else if (typeof define === 'function' && define.amd) {
  14. define('highcharts/modules/dumbbell', ['highcharts'], function (Highcharts) {
  15. factory(Highcharts);
  16. factory.Highcharts = Highcharts;
  17. return factory;
  18. });
  19. } else {
  20. factory(typeof Highcharts !== 'undefined' ? Highcharts : undefined);
  21. }
  22. }(function (Highcharts) {
  23. var _modules = Highcharts ? Highcharts._modules : {};
  24. function _registerModule(obj, path, args, fn) {
  25. if (!obj.hasOwnProperty(path)) {
  26. obj[path] = fn.apply(null, args);
  27. }
  28. }
  29. _registerModule(_modules, 'Series/AreaRange/AreaRangePoint.js', [_modules['Series/Area/AreaSeries.js'], _modules['Core/Series/Point.js'], _modules['Core/Utilities.js']], function (AreaSeries, Point, U) {
  30. /* *
  31. *
  32. * (c) 2010-2021 Torstein Honsi
  33. *
  34. * License: www.highcharts.com/license
  35. *
  36. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  37. *
  38. * */
  39. var __extends = (this && this.__extends) || (function () {
  40. var extendStatics = function (d,
  41. b) {
  42. extendStatics = Object.setPrototypeOf ||
  43. ({ __proto__: [] } instanceof Array && function (d,
  44. b) { d.__proto__ = b; }) ||
  45. function (d,
  46. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  47. return extendStatics(d, b);
  48. };
  49. return function (d, b) {
  50. extendStatics(d, b);
  51. function __() { this.constructor = d; }
  52. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  53. };
  54. })();
  55. var pointProto = Point.prototype;
  56. var defined = U.defined,
  57. isNumber = U.isNumber;
  58. /* *
  59. *
  60. * Class
  61. *
  62. * */
  63. var AreaRangePoint = /** @class */ (function (_super) {
  64. __extends(AreaRangePoint, _super);
  65. function AreaRangePoint() {
  66. /* *
  67. *
  68. * Properties
  69. *
  70. * */
  71. var _this = _super !== null && _super.apply(this,
  72. arguments) || this;
  73. _this.high = void 0;
  74. _this.low = void 0;
  75. _this.options = void 0;
  76. _this.plotHigh = void 0;
  77. _this.plotLow = void 0;
  78. _this.plotHighX = void 0;
  79. _this.plotLowX = void 0;
  80. _this.plotX = void 0;
  81. _this.series = void 0;
  82. return _this;
  83. }
  84. /* *
  85. *
  86. * Functions
  87. *
  88. * */
  89. /**
  90. * @private
  91. */
  92. AreaRangePoint.prototype.setState = function () {
  93. var prevState = this.state,
  94. series = this.series,
  95. isPolar = series.chart.polar;
  96. if (!defined(this.plotHigh)) {
  97. // Boost doesn't calculate plotHigh
  98. this.plotHigh = series.yAxis.toPixels(this.high, true);
  99. }
  100. if (!defined(this.plotLow)) {
  101. // Boost doesn't calculate plotLow
  102. this.plotLow = this.plotY = series.yAxis.toPixels(this.low, true);
  103. }
  104. if (series.stateMarkerGraphic) {
  105. series.lowerStateMarkerGraphic = series.stateMarkerGraphic;
  106. series.stateMarkerGraphic = series.upperStateMarkerGraphic;
  107. }
  108. // Change state also for the top marker
  109. this.graphic = this.upperGraphic;
  110. this.plotY = this.plotHigh;
  111. if (isPolar) {
  112. this.plotX = this.plotHighX;
  113. }
  114. // Top state:
  115. pointProto.setState.apply(this, arguments);
  116. this.state = prevState;
  117. // Now restore defaults
  118. this.plotY = this.plotLow;
  119. this.graphic = this.lowerGraphic;
  120. if (isPolar) {
  121. this.plotX = this.plotLowX;
  122. }
  123. if (series.stateMarkerGraphic) {
  124. series.upperStateMarkerGraphic = series.stateMarkerGraphic;
  125. series.stateMarkerGraphic = series.lowerStateMarkerGraphic;
  126. // Lower marker is stored at stateMarkerGraphic
  127. // to avoid reference duplication (#7021)
  128. series.lowerStateMarkerGraphic = void 0;
  129. }
  130. pointProto.setState.apply(this, arguments);
  131. };
  132. AreaRangePoint.prototype.haloPath = function () {
  133. var isPolar = this.series.chart.polar,
  134. path = [];
  135. // Bottom halo
  136. this.plotY = this.plotLow;
  137. if (isPolar) {
  138. this.plotX = this.plotLowX;
  139. }
  140. if (this.isInside) {
  141. path = pointProto.haloPath.apply(this, arguments);
  142. }
  143. // Top halo
  144. this.plotY = this.plotHigh;
  145. if (isPolar) {
  146. this.plotX = this.plotHighX;
  147. }
  148. if (this.isTopInside) {
  149. path = path.concat(pointProto.haloPath.apply(this, arguments));
  150. }
  151. return path;
  152. };
  153. AreaRangePoint.prototype.isValid = function () {
  154. return isNumber(this.low) && isNumber(this.high);
  155. };
  156. return AreaRangePoint;
  157. }(AreaSeries.prototype.pointClass));
  158. /* *
  159. *
  160. * Default export
  161. *
  162. * */
  163. return AreaRangePoint;
  164. });
  165. _registerModule(_modules, 'Series/Dumbbell/DumbbellPoint.js', [_modules['Series/AreaRange/AreaRangePoint.js'], _modules['Core/Utilities.js']], function (AreaRangePoint, U) {
  166. /* *
  167. *
  168. * (c) 2010-2021 Sebastian Bochan, Rafal Sebestjanski
  169. *
  170. * License: www.highcharts.com/license
  171. *
  172. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  173. *
  174. * */
  175. var __extends = (this && this.__extends) || (function () {
  176. var extendStatics = function (d,
  177. b) {
  178. extendStatics = Object.setPrototypeOf ||
  179. ({ __proto__: [] } instanceof Array && function (d,
  180. b) { d.__proto__ = b; }) ||
  181. function (d,
  182. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  183. return extendStatics(d, b);
  184. };
  185. return function (d, b) {
  186. extendStatics(d, b);
  187. function __() { this.constructor = d; }
  188. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  189. };
  190. })();
  191. var extend = U.extend,
  192. pick = U.pick;
  193. /* *
  194. *
  195. * Class
  196. *
  197. * */
  198. var DumbbellPoint = /** @class */ (function (_super) {
  199. __extends(DumbbellPoint, _super);
  200. function DumbbellPoint() {
  201. /* *
  202. *
  203. * Properties
  204. *
  205. * */
  206. var _this = _super !== null && _super.apply(this,
  207. arguments) || this;
  208. _this.series = void 0;
  209. _this.options = void 0;
  210. _this.connector = void 0;
  211. _this.pointWidth = void 0;
  212. return _this;
  213. }
  214. /* *
  215. *
  216. * Functions
  217. *
  218. * */
  219. /**
  220. * Set the point's state extended by have influence on the connector
  221. * (between low and high value).
  222. *
  223. * @private
  224. * @param {Highcharts.Point} this The point to inspect.
  225. *
  226. * @return {void}
  227. */
  228. DumbbellPoint.prototype.setState = function () {
  229. var point = this,
  230. series = point.series,
  231. chart = series.chart,
  232. seriesLowColor = series.options.lowColor,
  233. seriesMarker = series.options.marker,
  234. pointOptions = point.options,
  235. pointLowColor = pointOptions.lowColor,
  236. zoneColor = point.zone && point.zone.color,
  237. lowerGraphicColor = pick(pointLowColor,
  238. seriesLowColor,
  239. pointOptions.color,
  240. zoneColor,
  241. point.color,
  242. series.color),
  243. verb = 'attr',
  244. upperGraphicColor,
  245. origProps;
  246. this.pointSetState.apply(this, arguments);
  247. if (!point.state) {
  248. verb = 'animate';
  249. if (point.lowerGraphic && !chart.styledMode) {
  250. point.lowerGraphic.attr({
  251. fill: lowerGraphicColor
  252. });
  253. if (point.upperGraphic) {
  254. origProps = {
  255. y: point.y,
  256. zone: point.zone
  257. };
  258. point.y = point.high;
  259. point.zone = point.zone ? point.getZone() : void 0;
  260. upperGraphicColor = pick(point.marker ? point.marker.fillColor : void 0, seriesMarker ? seriesMarker.fillColor : void 0, pointOptions.color, point.zone ? point.zone.color : void 0, point.color);
  261. point.upperGraphic.attr({
  262. fill: upperGraphicColor
  263. });
  264. extend(point, origProps);
  265. }
  266. }
  267. }
  268. point.connector[verb](series.getConnectorAttribs(point));
  269. };
  270. return DumbbellPoint;
  271. }(AreaRangePoint));
  272. extend(DumbbellPoint.prototype, {
  273. pointSetState: AreaRangePoint.prototype.setState
  274. });
  275. /* *
  276. *
  277. * Default export
  278. *
  279. * */
  280. return DumbbellPoint;
  281. });
  282. _registerModule(_modules, 'Series/Dumbbell/DumbbellSeries.js', [_modules['Series/Column/ColumnSeries.js'], _modules['Series/Dumbbell/DumbbellPoint.js'], _modules['Core/Globals.js'], _modules['Core/Color/Palette.js'], _modules['Core/Series/Series.js'], _modules['Core/Series/SeriesRegistry.js'], _modules['Core/Renderer/SVG/SVGRenderer.js'], _modules['Core/Utilities.js']], function (ColumnSeries, DumbbellPoint, H, palette, Series, SeriesRegistry, SVGRenderer, U) {
  283. /* *
  284. *
  285. * (c) 2010-2021 Sebastian Bochan, Rafal Sebestjanski
  286. *
  287. * License: www.highcharts.com/license
  288. *
  289. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  290. *
  291. * */
  292. var __extends = (this && this.__extends) || (function () {
  293. var extendStatics = function (d,
  294. b) {
  295. extendStatics = Object.setPrototypeOf ||
  296. ({ __proto__: [] } instanceof Array && function (d,
  297. b) { d.__proto__ = b; }) ||
  298. function (d,
  299. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  300. return extendStatics(d, b);
  301. };
  302. return function (d, b) {
  303. extendStatics(d, b);
  304. function __() { this.constructor = d; }
  305. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  306. };
  307. })();
  308. var colProto = ColumnSeries.prototype;
  309. var noop = H.noop;
  310. var seriesProto = Series.prototype;
  311. var _a = SeriesRegistry.seriesTypes,
  312. AreaRangeSeries = _a.arearange,
  313. columnRangeProto = _a.columnrange.prototype;
  314. var areaRangeProto = AreaRangeSeries.prototype;
  315. var extend = U.extend,
  316. merge = U.merge,
  317. pick = U.pick;
  318. /**
  319. * The dumbbell series type
  320. *
  321. * @private
  322. * @class
  323. * @name Highcharts.seriesTypes.dumbbell
  324. *
  325. * @augments Highcharts.Series
  326. */
  327. var DumbbellSeries = /** @class */ (function (_super) {
  328. __extends(DumbbellSeries, _super);
  329. function DumbbellSeries() {
  330. /* *
  331. *
  332. * Static properties
  333. *
  334. * */
  335. var _this = _super !== null && _super.apply(this,
  336. arguments) || this;
  337. /* *
  338. *
  339. * Properties
  340. *
  341. * */
  342. _this.data = void 0;
  343. _this.options = void 0;
  344. _this.points = void 0;
  345. _this.columnMetrics = void 0;
  346. return _this;
  347. }
  348. /**
  349. *
  350. * Functions
  351. *
  352. */
  353. /**
  354. * Get connector line path and styles that connects dumbbell point's low and
  355. * high values.
  356. * @private
  357. *
  358. * @param {Highcharts.Point} point The point to inspect.
  359. *
  360. * @return {Highcharts.SVGAttributes} attribs The path and styles.
  361. */
  362. DumbbellSeries.prototype.getConnectorAttribs = function (point) {
  363. var series = this,
  364. chart = series.chart,
  365. pointOptions = point.options,
  366. seriesOptions = series.options,
  367. xAxis = series.xAxis,
  368. yAxis = series.yAxis,
  369. connectorWidth = pick(pointOptions.connectorWidth,
  370. seriesOptions.connectorWidth),
  371. connectorColor = pick(pointOptions.connectorColor,
  372. seriesOptions.connectorColor,
  373. pointOptions.color,
  374. point.zone ? point.zone.color : void 0,
  375. point.color),
  376. connectorWidthPlus = pick(seriesOptions.states &&
  377. seriesOptions.states.hover &&
  378. seriesOptions.states.hover.connectorWidthPlus, 1),
  379. dashStyle = pick(pointOptions.dashStyle,
  380. seriesOptions.dashStyle),
  381. pointTop = pick(point.plotLow,
  382. point.plotY),
  383. pxThreshold = yAxis.toPixels(seriesOptions.threshold || 0,
  384. true),
  385. pointHeight = chart.inverted ?
  386. yAxis.len - pxThreshold : pxThreshold,
  387. pointBottom = pick(point.plotHigh,
  388. pointHeight),
  389. attribs,
  390. origProps;
  391. if (point.state) {
  392. connectorWidth = connectorWidth + connectorWidthPlus;
  393. }
  394. if (pointTop < 0) {
  395. pointTop = 0;
  396. }
  397. else if (pointTop >= yAxis.len) {
  398. pointTop = yAxis.len;
  399. }
  400. if (pointBottom < 0) {
  401. pointBottom = 0;
  402. }
  403. else if (pointBottom >= yAxis.len) {
  404. pointBottom = yAxis.len;
  405. }
  406. if (point.plotX < 0 || point.plotX > xAxis.len) {
  407. connectorWidth = 0;
  408. }
  409. // Connector should reflect upper marker's zone color
  410. if (point.upperGraphic) {
  411. origProps = {
  412. y: point.y,
  413. zone: point.zone
  414. };
  415. point.y = point.high;
  416. point.zone = point.zone ? point.getZone() : void 0;
  417. connectorColor = pick(pointOptions.connectorColor, seriesOptions.connectorColor, pointOptions.color, point.zone ? point.zone.color : void 0, point.color);
  418. extend(point, origProps);
  419. }
  420. attribs = {
  421. d: SVGRenderer.prototype.crispLine([[
  422. 'M',
  423. point.plotX,
  424. pointTop
  425. ], [
  426. 'L',
  427. point.plotX,
  428. pointBottom
  429. ]], connectorWidth, 'ceil')
  430. };
  431. if (!chart.styledMode) {
  432. attribs.stroke = connectorColor;
  433. attribs['stroke-width'] = connectorWidth;
  434. if (dashStyle) {
  435. attribs.dashstyle = dashStyle;
  436. }
  437. }
  438. return attribs;
  439. };
  440. /**
  441. * Draw connector line that connects dumbbell point's low and high values.
  442. * @private
  443. *
  444. * @param {Highcharts.Point} point The point to inspect.
  445. *
  446. * @return {void}
  447. */
  448. DumbbellSeries.prototype.drawConnector = function (point) {
  449. var series = this,
  450. animationLimit = pick(series.options.animationLimit, 250),
  451. verb = point.connector && series.chart.pointCount < animationLimit ?
  452. 'animate' : 'attr';
  453. if (!point.connector) {
  454. point.connector = series.chart.renderer.path()
  455. .addClass('highcharts-lollipop-stem')
  456. .attr({
  457. zIndex: -1
  458. })
  459. .add(series.markerGroup);
  460. }
  461. point.connector[verb](this.getConnectorAttribs(point));
  462. };
  463. /**
  464. * Return the width and x offset of the dumbbell adjusted for grouping,
  465. * groupPadding, pointPadding, pointWidth etc.
  466. *
  467. * @private
  468. *
  469. * @function Highcharts.seriesTypes.column#getColumnMetrics
  470. *
  471. * @param {Highcharts.Series} this The series of points.
  472. *
  473. * @return {Highcharts.ColumnMetricsObject} metrics shapeArgs
  474. *
  475. */
  476. DumbbellSeries.prototype.getColumnMetrics = function () {
  477. var metrics = colProto.getColumnMetrics.apply(this,
  478. arguments);
  479. metrics.offset += metrics.width / 2;
  480. return metrics;
  481. };
  482. /**
  483. * Translate each point to the plot area coordinate system and find
  484. * shape positions
  485. *
  486. * @private
  487. *
  488. * @function Highcharts.seriesTypes.dumbbell#translate
  489. *
  490. * @param {Highcharts.Series} this The series of points.
  491. *
  492. * @return {void}
  493. */
  494. DumbbellSeries.prototype.translate = function () {
  495. // Calculate shapeargs
  496. this.setShapeArgs.apply(this);
  497. // Calculate point low / high values
  498. this.translatePoint.apply(this, arguments);
  499. // Correct x position
  500. this.points.forEach(function (point) {
  501. var shapeArgs = point.shapeArgs,
  502. pointWidth = point.pointWidth;
  503. point.plotX = shapeArgs.x;
  504. shapeArgs.x = point.plotX - pointWidth / 2;
  505. point.tooltipPos = null;
  506. });
  507. this.columnMetrics.offset -= this.columnMetrics.width / 2;
  508. };
  509. /**
  510. * Extend the arearange series' drawPoints method by applying a connector
  511. * and coloring markers.
  512. * @private
  513. *
  514. * @function Highcharts.Series#drawPoints
  515. *
  516. * @param {Highcharts.Series} this The series of points.
  517. *
  518. * @return {void}
  519. */
  520. DumbbellSeries.prototype.drawPoints = function () {
  521. var series = this,
  522. chart = series.chart,
  523. pointLength = series.points.length,
  524. seriesLowColor = series.lowColor = series.options.lowColor,
  525. i = 0,
  526. lowerGraphicColor,
  527. point,
  528. zoneColor;
  529. this.seriesDrawPoints.apply(series, arguments);
  530. // Draw connectors and color upper markers
  531. while (i < pointLength) {
  532. point = series.points[i];
  533. series.drawConnector(point);
  534. if (point.upperGraphic) {
  535. point.upperGraphic.element.point = point;
  536. point.upperGraphic.addClass('highcharts-lollipop-high');
  537. }
  538. point.connector.element.point = point;
  539. if (point.lowerGraphic) {
  540. zoneColor = point.zone && point.zone.color;
  541. lowerGraphicColor = pick(point.options.lowColor, seriesLowColor, point.options.color, zoneColor, point.color, series.color);
  542. if (!chart.styledMode) {
  543. point.lowerGraphic.attr({
  544. fill: lowerGraphicColor
  545. });
  546. }
  547. point.lowerGraphic.addClass('highcharts-lollipop-low');
  548. }
  549. i++;
  550. }
  551. };
  552. /**
  553. * Get non-presentational attributes for a point. Used internally for
  554. * both styled mode and classic. Set correct position in link with connector
  555. * line.
  556. *
  557. * @see Series#pointAttribs
  558. *
  559. * @function Highcharts.Series#markerAttribs
  560. *
  561. * @param {Highcharts.Series} this The series of points.
  562. *
  563. * @return {Highcharts.SVGAttributes}
  564. * A hash containing those attributes that are not settable from
  565. * CSS.
  566. */
  567. DumbbellSeries.prototype.markerAttribs = function () {
  568. var ret = areaRangeProto.markerAttribs.apply(this,
  569. arguments);
  570. ret.x = Math.floor(ret.x);
  571. ret.y = Math.floor(ret.y);
  572. return ret;
  573. };
  574. /**
  575. * Get presentational attributes
  576. *
  577. * @private
  578. * @function Highcharts.seriesTypes.column#pointAttribs
  579. *
  580. * @param {Highcharts.Point} point The point to inspect.
  581. * @param {string} state current state of point (normal, hover, select)
  582. *
  583. * @return {Highcharts.SVGAttributes} pointAttribs SVGAttributes
  584. */
  585. DumbbellSeries.prototype.pointAttribs = function (point, state) {
  586. var pointAttribs;
  587. pointAttribs = seriesProto.pointAttribs.apply(this, arguments);
  588. if (state === 'hover') {
  589. delete pointAttribs.fill;
  590. }
  591. return pointAttribs;
  592. };
  593. /**
  594. * The dumbbell series is a cartesian series with higher and lower values
  595. * for each point along an X axis, connected with a line between the
  596. * values.
  597. *
  598. * Requires `highcharts-more.js` and `modules/dumbbell.js`.
  599. *
  600. * @sample {highcharts} highcharts/demo/dumbbell/
  601. * Dumbbell chart
  602. * @sample {highcharts} highcharts/series-dumbbell/styled-mode-dumbbell/
  603. * Styled mode
  604. *
  605. * @extends plotOptions.arearange
  606. * @product highcharts highstock
  607. * @excluding fillColor, fillOpacity, lineWidth, stack, stacking,
  608. * stickyTracking, trackByArea, boostThreshold, boostBlending
  609. * @since 8.0.0
  610. * @optionparent plotOptions.dumbbell
  611. */
  612. DumbbellSeries.defaultOptions = merge(AreaRangeSeries.defaultOptions, {
  613. /** @ignore-option */
  614. trackByArea: false,
  615. /** @ignore-option */
  616. fillColor: 'none',
  617. /** @ignore-option */
  618. lineWidth: 0,
  619. pointRange: 1,
  620. /**
  621. * Pixel width of the line that connects the dumbbell point's
  622. * values.
  623. *
  624. * @since 8.0.0
  625. * @product highcharts highstock
  626. */
  627. connectorWidth: 1,
  628. /** @ignore-option */
  629. stickyTracking: false,
  630. groupPadding: 0.2,
  631. crisp: false,
  632. pointPadding: 0.1,
  633. /**
  634. * Color of the start markers in a dumbbell graph.
  635. *
  636. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  637. * @since 8.0.0
  638. * @product highcharts highstock
  639. */
  640. lowColor: palette.neutralColor80,
  641. /**
  642. * Color of the line that connects the dumbbell point's values.
  643. * By default it is the series' color.
  644. *
  645. * @type {string}
  646. * @product highcharts highstock
  647. * @since 8.0.0
  648. * @apioption plotOptions.dumbbell.connectorColor
  649. */
  650. states: {
  651. hover: {
  652. /** @ignore-option */
  653. lineWidthPlus: 0,
  654. /**
  655. * The additional connector line width for a hovered point.
  656. *
  657. * @since 8.0.0
  658. * @product highcharts highstock
  659. */
  660. connectorWidthPlus: 1,
  661. /** @ignore-option */
  662. halo: false
  663. }
  664. }
  665. });
  666. return DumbbellSeries;
  667. }(AreaRangeSeries));
  668. extend(DumbbellSeries.prototype, {
  669. crispCol: colProto.crispCol,
  670. drawGraph: noop,
  671. drawTracker: ColumnSeries.prototype.drawTracker,
  672. pointClass: DumbbellPoint,
  673. setShapeArgs: columnRangeProto.translate,
  674. seriesDrawPoints: areaRangeProto.drawPoints,
  675. trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
  676. translatePoint: areaRangeProto.translate
  677. });
  678. SeriesRegistry.registerSeriesType('dumbbell', DumbbellSeries);
  679. /* *
  680. *
  681. * Default export
  682. *
  683. * */
  684. /* *
  685. *
  686. * API options
  687. *
  688. * */
  689. /**
  690. * The `dumbbell` series. If the [type](#series.dumbbell.type) option is
  691. * not specified, it is inherited from [chart.type](#chart.type).
  692. *
  693. * @extends series,plotOptions.dumbbell
  694. * @excluding boostThreshold, boostBlending
  695. * @product highcharts highstock
  696. * @requires highcharts-more
  697. * @requires modules/dumbbell
  698. * @apioption series.dumbbell
  699. */
  700. /**
  701. * An array of data points for the series. For the `dumbbell` series
  702. * type, points can be given in the following ways:
  703. *
  704. * 1. An array of arrays with 3 or 2 values. In this case, the values correspond
  705. * to `x,low,high`. If the first value is a string, it is applied as the name
  706. * of the point, and the `x` value is inferred. The `x` value can also be
  707. * omitted, in which case the inner arrays should be of length 2\. Then the
  708. * `x` value is automatically calculated, either starting at 0 and
  709. * incremented by 1, or from `pointStart` and `pointInterval` given in the
  710. * series options.
  711. * ```js
  712. * data: [
  713. * [0, 4, 2],
  714. * [1, 2, 1],
  715. * [2, 9, 10]
  716. * ]
  717. * ```
  718. *
  719. * 2. An array of objects with named values. The following snippet shows only a
  720. * few settings, see the complete options set below. If the total number of
  721. * data points exceeds the series'
  722. * [turboThreshold](#series.dumbbell.turboThreshold), this option is not
  723. * available.
  724. * ```js
  725. * data: [{
  726. * x: 1,
  727. * low: 0,
  728. * high: 4,
  729. * name: "Point2",
  730. * color: "#00FF00",
  731. * lowColor: "#00FFFF",
  732. * connectorWidth: 3,
  733. * connectorColor: "#FF00FF"
  734. * }, {
  735. * x: 1,
  736. * low: 5,
  737. * high: 3,
  738. * name: "Point1",
  739. * color: "#FF00FF"
  740. * }]
  741. * ```
  742. *
  743. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  744. * Arrays of numeric x and y
  745. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  746. * Arrays of datetime x and y
  747. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  748. * Arrays of point.name and y
  749. * @sample {highcharts} highcharts/series/data-array-of-objects/
  750. * Config objects
  751. *
  752. * @type {Array<Array<(number|string),number>|Array<(number|string),number,number>|*>}
  753. * @extends series.arearange.data
  754. * @product highcharts highstock
  755. * @apioption series.dumbbell.data
  756. */
  757. /**
  758. * Color of the line that connects the dumbbell point's values.
  759. * By default it is the series' color.
  760. *
  761. * @type {string}
  762. * @since 8.0.0
  763. * @product highcharts highstock
  764. * @apioption series.dumbbell.data.connectorColor
  765. */
  766. /**
  767. * Pixel width of the line that connects the dumbbell point's values.
  768. *
  769. * @type {number}
  770. * @since 8.0.0
  771. * @default 1
  772. * @product highcharts highstock
  773. * @apioption series.dumbbell.data.connectorWidth
  774. */
  775. /**
  776. * Color of the start markers in a dumbbell graph.
  777. *
  778. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  779. * @since 8.0.0
  780. * @default ${palette.neutralColor80}
  781. * @product highcharts highstock
  782. * @apioption series.dumbbell.data.lowColor
  783. */
  784. ''; // adds doclets above to transpiled file
  785. return DumbbellSeries;
  786. });
  787. _registerModule(_modules, 'masters/modules/dumbbell.src.js', [], function () {
  788. });
  789. }));