dumbbell.src.js 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. /**
  2. * @license Highcharts JS v9.1.1 (2021-06-04)
  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. DumbbellPoint.prototype.destroy = function () {
  271. // #15560
  272. if (!this.graphic) {
  273. this.graphic = this.connector;
  274. this.connector = void 0;
  275. }
  276. return _super.prototype.destroy.call(this);
  277. };
  278. return DumbbellPoint;
  279. }(AreaRangePoint));
  280. extend(DumbbellPoint.prototype, {
  281. pointSetState: AreaRangePoint.prototype.setState
  282. });
  283. /* *
  284. *
  285. * Default export
  286. *
  287. * */
  288. return DumbbellPoint;
  289. });
  290. _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) {
  291. /* *
  292. *
  293. * (c) 2010-2021 Sebastian Bochan, Rafal Sebestjanski
  294. *
  295. * License: www.highcharts.com/license
  296. *
  297. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  298. *
  299. * */
  300. var __extends = (this && this.__extends) || (function () {
  301. var extendStatics = function (d,
  302. b) {
  303. extendStatics = Object.setPrototypeOf ||
  304. ({ __proto__: [] } instanceof Array && function (d,
  305. b) { d.__proto__ = b; }) ||
  306. function (d,
  307. b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  308. return extendStatics(d, b);
  309. };
  310. return function (d, b) {
  311. extendStatics(d, b);
  312. function __() { this.constructor = d; }
  313. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  314. };
  315. })();
  316. var colProto = ColumnSeries.prototype;
  317. var noop = H.noop;
  318. var seriesProto = Series.prototype;
  319. var _a = SeriesRegistry.seriesTypes,
  320. AreaRangeSeries = _a.arearange,
  321. columnRangeProto = _a.columnrange.prototype;
  322. var areaRangeProto = AreaRangeSeries.prototype;
  323. var extend = U.extend,
  324. merge = U.merge,
  325. pick = U.pick;
  326. /**
  327. * The dumbbell series type
  328. *
  329. * @private
  330. * @class
  331. * @name Highcharts.seriesTypes.dumbbell
  332. *
  333. * @augments Highcharts.Series
  334. */
  335. var DumbbellSeries = /** @class */ (function (_super) {
  336. __extends(DumbbellSeries, _super);
  337. function DumbbellSeries() {
  338. /* *
  339. *
  340. * Static properties
  341. *
  342. * */
  343. var _this = _super !== null && _super.apply(this,
  344. arguments) || this;
  345. /* *
  346. *
  347. * Properties
  348. *
  349. * */
  350. _this.data = void 0;
  351. _this.options = void 0;
  352. _this.points = void 0;
  353. _this.columnMetrics = void 0;
  354. return _this;
  355. }
  356. /**
  357. *
  358. * Functions
  359. *
  360. */
  361. /**
  362. * Get connector line path and styles that connects dumbbell point's low and
  363. * high values.
  364. * @private
  365. *
  366. * @param {Highcharts.Point} point The point to inspect.
  367. *
  368. * @return {Highcharts.SVGAttributes} attribs The path and styles.
  369. */
  370. DumbbellSeries.prototype.getConnectorAttribs = function (point) {
  371. var series = this,
  372. chart = series.chart,
  373. pointOptions = point.options,
  374. seriesOptions = series.options,
  375. xAxis = series.xAxis,
  376. yAxis = series.yAxis,
  377. connectorWidth = pick(pointOptions.connectorWidth,
  378. seriesOptions.connectorWidth),
  379. connectorColor = pick(pointOptions.connectorColor,
  380. seriesOptions.connectorColor,
  381. pointOptions.color,
  382. point.zone ? point.zone.color : void 0,
  383. point.color),
  384. connectorWidthPlus = pick(seriesOptions.states &&
  385. seriesOptions.states.hover &&
  386. seriesOptions.states.hover.connectorWidthPlus, 1),
  387. dashStyle = pick(pointOptions.dashStyle,
  388. seriesOptions.dashStyle),
  389. pointTop = pick(point.plotLow,
  390. point.plotY),
  391. pxThreshold = yAxis.toPixels(seriesOptions.threshold || 0,
  392. true),
  393. pointHeight = chart.inverted ?
  394. yAxis.len - pxThreshold : pxThreshold,
  395. pointBottom = pick(point.plotHigh,
  396. pointHeight),
  397. attribs,
  398. origProps;
  399. if (point.state) {
  400. connectorWidth = connectorWidth + connectorWidthPlus;
  401. }
  402. if (pointTop < 0) {
  403. pointTop = 0;
  404. }
  405. else if (pointTop >= yAxis.len) {
  406. pointTop = yAxis.len;
  407. }
  408. if (pointBottom < 0) {
  409. pointBottom = 0;
  410. }
  411. else if (pointBottom >= yAxis.len) {
  412. pointBottom = yAxis.len;
  413. }
  414. if (point.plotX < 0 || point.plotX > xAxis.len) {
  415. connectorWidth = 0;
  416. }
  417. // Connector should reflect upper marker's zone color
  418. if (point.upperGraphic) {
  419. origProps = {
  420. y: point.y,
  421. zone: point.zone
  422. };
  423. point.y = point.high;
  424. point.zone = point.zone ? point.getZone() : void 0;
  425. connectorColor = pick(pointOptions.connectorColor, seriesOptions.connectorColor, pointOptions.color, point.zone ? point.zone.color : void 0, point.color);
  426. extend(point, origProps);
  427. }
  428. attribs = {
  429. d: SVGRenderer.prototype.crispLine([[
  430. 'M',
  431. point.plotX,
  432. pointTop
  433. ], [
  434. 'L',
  435. point.plotX,
  436. pointBottom
  437. ]], connectorWidth, 'ceil')
  438. };
  439. if (!chart.styledMode) {
  440. attribs.stroke = connectorColor;
  441. attribs['stroke-width'] = connectorWidth;
  442. if (dashStyle) {
  443. attribs.dashstyle = dashStyle;
  444. }
  445. }
  446. return attribs;
  447. };
  448. /**
  449. * Draw connector line that connects dumbbell point's low and high values.
  450. * @private
  451. *
  452. * @param {Highcharts.Point} point The point to inspect.
  453. *
  454. * @return {void}
  455. */
  456. DumbbellSeries.prototype.drawConnector = function (point) {
  457. var series = this,
  458. animationLimit = pick(series.options.animationLimit, 250),
  459. verb = point.connector && series.chart.pointCount < animationLimit ?
  460. 'animate' : 'attr';
  461. if (!point.connector) {
  462. point.connector = series.chart.renderer.path()
  463. .addClass('highcharts-lollipop-stem')
  464. .attr({
  465. zIndex: -1
  466. })
  467. .add(series.markerGroup);
  468. }
  469. point.connector[verb](this.getConnectorAttribs(point));
  470. };
  471. /**
  472. * Return the width and x offset of the dumbbell adjusted for grouping,
  473. * groupPadding, pointPadding, pointWidth etc.
  474. *
  475. * @private
  476. *
  477. * @function Highcharts.seriesTypes.column#getColumnMetrics
  478. *
  479. * @param {Highcharts.Series} this The series of points.
  480. *
  481. * @return {Highcharts.ColumnMetricsObject} metrics shapeArgs
  482. *
  483. */
  484. DumbbellSeries.prototype.getColumnMetrics = function () {
  485. var metrics = colProto.getColumnMetrics.apply(this,
  486. arguments);
  487. metrics.offset += metrics.width / 2;
  488. return metrics;
  489. };
  490. /**
  491. * Translate each point to the plot area coordinate system and find
  492. * shape positions
  493. *
  494. * @private
  495. *
  496. * @function Highcharts.seriesTypes.dumbbell#translate
  497. *
  498. * @param {Highcharts.Series} this The series of points.
  499. *
  500. * @return {void}
  501. */
  502. DumbbellSeries.prototype.translate = function () {
  503. // Calculate shapeargs
  504. this.setShapeArgs.apply(this);
  505. // Calculate point low / high values
  506. this.translatePoint.apply(this, arguments);
  507. // Correct x position
  508. this.points.forEach(function (point) {
  509. var shapeArgs = point.shapeArgs,
  510. pointWidth = point.pointWidth;
  511. point.plotX = shapeArgs.x;
  512. shapeArgs.x = point.plotX - pointWidth / 2;
  513. point.tooltipPos = null;
  514. });
  515. this.columnMetrics.offset -= this.columnMetrics.width / 2;
  516. };
  517. /**
  518. * Extend the arearange series' drawPoints method by applying a connector
  519. * and coloring markers.
  520. * @private
  521. *
  522. * @function Highcharts.Series#drawPoints
  523. *
  524. * @param {Highcharts.Series} this The series of points.
  525. *
  526. * @return {void}
  527. */
  528. DumbbellSeries.prototype.drawPoints = function () {
  529. var series = this,
  530. chart = series.chart,
  531. pointLength = series.points.length,
  532. seriesLowColor = series.lowColor = series.options.lowColor,
  533. i = 0,
  534. lowerGraphicColor,
  535. point,
  536. zoneColor;
  537. this.seriesDrawPoints.apply(series, arguments);
  538. // Draw connectors and color upper markers
  539. while (i < pointLength) {
  540. point = series.points[i];
  541. series.drawConnector(point);
  542. if (point.upperGraphic) {
  543. point.upperGraphic.element.point = point;
  544. point.upperGraphic.addClass('highcharts-lollipop-high');
  545. }
  546. point.connector.element.point = point;
  547. if (point.lowerGraphic) {
  548. zoneColor = point.zone && point.zone.color;
  549. lowerGraphicColor = pick(point.options.lowColor, seriesLowColor, point.options.color, zoneColor, point.color, series.color);
  550. if (!chart.styledMode) {
  551. point.lowerGraphic.attr({
  552. fill: lowerGraphicColor
  553. });
  554. }
  555. point.lowerGraphic.addClass('highcharts-lollipop-low');
  556. }
  557. i++;
  558. }
  559. };
  560. /**
  561. * Get non-presentational attributes for a point. Used internally for
  562. * both styled mode and classic. Set correct position in link with connector
  563. * line.
  564. *
  565. * @see Series#pointAttribs
  566. *
  567. * @function Highcharts.Series#markerAttribs
  568. *
  569. * @param {Highcharts.Series} this The series of points.
  570. *
  571. * @return {Highcharts.SVGAttributes}
  572. * A hash containing those attributes that are not settable from
  573. * CSS.
  574. */
  575. DumbbellSeries.prototype.markerAttribs = function () {
  576. var ret = areaRangeProto.markerAttribs.apply(this,
  577. arguments);
  578. ret.x = Math.floor(ret.x || 0);
  579. ret.y = Math.floor(ret.y || 0);
  580. return ret;
  581. };
  582. /**
  583. * Get presentational attributes
  584. *
  585. * @private
  586. * @function Highcharts.seriesTypes.column#pointAttribs
  587. *
  588. * @param {Highcharts.Point} point The point to inspect.
  589. * @param {string} state current state of point (normal, hover, select)
  590. *
  591. * @return {Highcharts.SVGAttributes} pointAttribs SVGAttributes
  592. */
  593. DumbbellSeries.prototype.pointAttribs = function (point, state) {
  594. var pointAttribs;
  595. pointAttribs = seriesProto.pointAttribs.apply(this, arguments);
  596. if (state === 'hover') {
  597. delete pointAttribs.fill;
  598. }
  599. return pointAttribs;
  600. };
  601. /**
  602. * The dumbbell series is a cartesian series with higher and lower values
  603. * for each point along an X axis, connected with a line between the
  604. * values.
  605. *
  606. * Requires `highcharts-more.js` and `modules/dumbbell.js`.
  607. *
  608. * @sample {highcharts} highcharts/demo/dumbbell/
  609. * Dumbbell chart
  610. * @sample {highcharts} highcharts/series-dumbbell/styled-mode-dumbbell/
  611. * Styled mode
  612. *
  613. * @extends plotOptions.arearange
  614. * @product highcharts highstock
  615. * @excluding fillColor, fillOpacity, lineWidth, stack, stacking,
  616. * stickyTracking, trackByArea, boostThreshold, boostBlending
  617. * @since 8.0.0
  618. * @optionparent plotOptions.dumbbell
  619. */
  620. DumbbellSeries.defaultOptions = merge(AreaRangeSeries.defaultOptions, {
  621. /** @ignore-option */
  622. trackByArea: false,
  623. /** @ignore-option */
  624. fillColor: 'none',
  625. /** @ignore-option */
  626. lineWidth: 0,
  627. pointRange: 1,
  628. /**
  629. * Pixel width of the line that connects the dumbbell point's
  630. * values.
  631. *
  632. * @since 8.0.0
  633. * @product highcharts highstock
  634. */
  635. connectorWidth: 1,
  636. /** @ignore-option */
  637. stickyTracking: false,
  638. groupPadding: 0.2,
  639. crisp: false,
  640. pointPadding: 0.1,
  641. /**
  642. * Color of the start markers in a dumbbell graph.
  643. *
  644. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  645. * @since 8.0.0
  646. * @product highcharts highstock
  647. */
  648. lowColor: palette.neutralColor80,
  649. /**
  650. * Color of the line that connects the dumbbell point's values.
  651. * By default it is the series' color.
  652. *
  653. * @type {string}
  654. * @product highcharts highstock
  655. * @since 8.0.0
  656. * @apioption plotOptions.dumbbell.connectorColor
  657. */
  658. states: {
  659. hover: {
  660. /** @ignore-option */
  661. lineWidthPlus: 0,
  662. /**
  663. * The additional connector line width for a hovered point.
  664. *
  665. * @since 8.0.0
  666. * @product highcharts highstock
  667. */
  668. connectorWidthPlus: 1,
  669. /** @ignore-option */
  670. halo: false
  671. }
  672. }
  673. });
  674. return DumbbellSeries;
  675. }(AreaRangeSeries));
  676. extend(DumbbellSeries.prototype, {
  677. crispCol: colProto.crispCol,
  678. drawGraph: noop,
  679. drawTracker: ColumnSeries.prototype.drawTracker,
  680. pointClass: DumbbellPoint,
  681. setShapeArgs: columnRangeProto.translate,
  682. seriesDrawPoints: areaRangeProto.drawPoints,
  683. trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
  684. translatePoint: areaRangeProto.translate
  685. });
  686. SeriesRegistry.registerSeriesType('dumbbell', DumbbellSeries);
  687. /* *
  688. *
  689. * Default export
  690. *
  691. * */
  692. /* *
  693. *
  694. * API options
  695. *
  696. * */
  697. /**
  698. * The `dumbbell` series. If the [type](#series.dumbbell.type) option is
  699. * not specified, it is inherited from [chart.type](#chart.type).
  700. *
  701. * @extends series,plotOptions.dumbbell
  702. * @excluding boostThreshold, boostBlending
  703. * @product highcharts highstock
  704. * @requires highcharts-more
  705. * @requires modules/dumbbell
  706. * @apioption series.dumbbell
  707. */
  708. /**
  709. * An array of data points for the series. For the `dumbbell` series
  710. * type, points can be given in the following ways:
  711. *
  712. * 1. An array of arrays with 3 or 2 values. In this case, the values correspond
  713. * to `x,low,high`. If the first value is a string, it is applied as the name
  714. * of the point, and the `x` value is inferred. The `x` value can also be
  715. * omitted, in which case the inner arrays should be of length 2\. Then the
  716. * `x` value is automatically calculated, either starting at 0 and
  717. * incremented by 1, or from `pointStart` and `pointInterval` given in the
  718. * series options.
  719. * ```js
  720. * data: [
  721. * [0, 4, 2],
  722. * [1, 2, 1],
  723. * [2, 9, 10]
  724. * ]
  725. * ```
  726. *
  727. * 2. An array of objects with named values. The following snippet shows only a
  728. * few settings, see the complete options set below. If the total number of
  729. * data points exceeds the series'
  730. * [turboThreshold](#series.dumbbell.turboThreshold), this option is not
  731. * available.
  732. * ```js
  733. * data: [{
  734. * x: 1,
  735. * low: 0,
  736. * high: 4,
  737. * name: "Point2",
  738. * color: "#00FF00",
  739. * lowColor: "#00FFFF",
  740. * connectorWidth: 3,
  741. * connectorColor: "#FF00FF"
  742. * }, {
  743. * x: 1,
  744. * low: 5,
  745. * high: 3,
  746. * name: "Point1",
  747. * color: "#FF00FF"
  748. * }]
  749. * ```
  750. *
  751. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  752. * Arrays of numeric x and y
  753. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  754. * Arrays of datetime x and y
  755. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  756. * Arrays of point.name and y
  757. * @sample {highcharts} highcharts/series/data-array-of-objects/
  758. * Config objects
  759. *
  760. * @type {Array<Array<(number|string),number>|Array<(number|string),number,number>|*>}
  761. * @extends series.arearange.data
  762. * @product highcharts highstock
  763. * @apioption series.dumbbell.data
  764. */
  765. /**
  766. * Color of the line that connects the dumbbell point's values.
  767. * By default it is the series' color.
  768. *
  769. * @type {string}
  770. * @since 8.0.0
  771. * @product highcharts highstock
  772. * @apioption series.dumbbell.data.connectorColor
  773. */
  774. /**
  775. * Pixel width of the line that connects the dumbbell point's values.
  776. *
  777. * @type {number}
  778. * @since 8.0.0
  779. * @default 1
  780. * @product highcharts highstock
  781. * @apioption series.dumbbell.data.connectorWidth
  782. */
  783. /**
  784. * Color of the start markers in a dumbbell graph.
  785. *
  786. * @type {Highcharts.ColorString|Highcharts.GradientColorObject|Highcharts.PatternObject}
  787. * @since 8.0.0
  788. * @default ${palette.neutralColor80}
  789. * @product highcharts highstock
  790. * @apioption series.dumbbell.data.lowColor
  791. */
  792. ''; // adds doclets above to transpiled file
  793. return DumbbellSeries;
  794. });
  795. _registerModule(_modules, 'masters/modules/dumbbell.src.js', [], function () {
  796. });
  797. }));