lollipop.src.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /**
  2. * @license Highcharts JS v8.1.2 (2020-06-16)
  3. *
  4. * (c) 2009-2019 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/lollipop', ['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, 'modules/lollipop.src.js', [_modules['parts/Globals.js'], _modules['parts/Utilities.js']], function (H, U) {
  30. /* *
  31. *
  32. * (c) 2010-2020 Sebastian Bochan, Rafal Sebestjanski
  33. *
  34. * License: www.highcharts.com/license
  35. *
  36. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  37. *
  38. * */
  39. var seriesType = U.seriesType;
  40. var areaProto = H.seriesTypes.area.prototype, colProto = H.seriesTypes.column.prototype;
  41. /**
  42. * The lollipop series is a carteseian series with a line anchored from
  43. * the x axis and a dot at the end to mark the value.
  44. * Requires `highcharts-more.js`, `modules/dumbbell.js` and
  45. * `modules/lollipop.js`.
  46. *
  47. * @sample {highcharts} highcharts/demo/lollipop/
  48. * Lollipop chart
  49. * @sample {highcharts} highcharts/series-dumbbell/styled-mode-dumbbell/
  50. * Styled mode
  51. *
  52. * @extends plotOptions.dumbbell
  53. * @product highcharts highstock
  54. * @excluding fillColor, fillOpacity, lineWidth, stack, stacking, lowColor,
  55. * stickyTracking, trackByArea
  56. * @since 8.0.0
  57. * @optionparent plotOptions.lollipop
  58. */
  59. seriesType('lollipop', 'dumbbell', {
  60. /** @ignore-option */
  61. lowColor: void 0,
  62. /** @ignore-option */
  63. threshold: 0,
  64. /** @ignore-option */
  65. connectorWidth: 1,
  66. /** @ignore-option */
  67. groupPadding: 0.2,
  68. /** @ignore-option */
  69. pointPadding: 0.1,
  70. /** @ignore-option */
  71. states: {
  72. hover: {
  73. /** @ignore-option */
  74. lineWidthPlus: 0,
  75. /** @ignore-option */
  76. connectorWidthPlus: 1,
  77. /** @ignore-option */
  78. halo: false
  79. }
  80. },
  81. tooltip: {
  82. pointFormat: '<span style="color:{series.color}">●</span> {series.name}: <b>{point.y}</b><br/>'
  83. }
  84. }, {
  85. pointArrayMap: ['y'],
  86. pointValKey: 'y',
  87. toYData: function (point) {
  88. return [H.pick(point.y, point.low)];
  89. },
  90. translatePoint: areaProto.translate,
  91. drawPoint: areaProto.drawPoints,
  92. drawDataLabels: colProto.drawDataLabels,
  93. setShapeArgs: colProto.translate
  94. }, {
  95. pointSetState: areaProto.pointClass.prototype.setState,
  96. setState: H.seriesTypes.dumbbell.prototype.pointClass.prototype.setState,
  97. init: function (series, options, x) {
  98. if (H.isObject(options) && 'low' in options) {
  99. options.y = options.low;
  100. delete options.low;
  101. }
  102. return H.Point.prototype.init.apply(this, arguments);
  103. }
  104. });
  105. /**
  106. * The `lollipop` series. If the [type](#series.lollipop.type) option is
  107. * not specified, it is inherited from [chart.type](#chart.type).
  108. *
  109. * @extends series,plotOptions.lollipop
  110. * @product highcharts highstock
  111. * @requires highcharts-more
  112. * @requires modules/dumbbell
  113. * @requires modules/lollipop
  114. * @apioption series.lollipop
  115. */
  116. /**
  117. * An array of data points for the series. For the `lollipop` series type,
  118. * points can be given in the following ways:
  119. *
  120. * 1. An array of numerical values. In this case, the numerical values will be
  121. * interpreted as `y` options. The `x` values will be automatically
  122. * calculated, either starting at 0 and incremented by 1, or from
  123. * `pointStart` and `pointInterval` given in the series options. If the axis
  124. * has categories, these will be used. Example:
  125. * ```js
  126. * data: [0, 5, 3, 5]
  127. * ```
  128. *
  129. * 2. An array of arrays with 2 values. In this case, the values correspond to
  130. * `x,y`. If the first value is a string, it is applied as the name of the
  131. * point, and the `x` value is inferred.
  132. * ```js
  133. * data: [
  134. * [0, 6],
  135. * [1, 2],
  136. * [2, 6]
  137. * ]
  138. * ```
  139. *
  140. * 3. An array of objects with named values. The following snippet shows only a
  141. * few settings, see the complete options set below. If the total number of
  142. * data points exceeds the series'
  143. * [turboThreshold](#series.lollipop.turboThreshold), this option is not
  144. * available.
  145. * ```js
  146. * data: [{
  147. * x: 1,
  148. * y: 9,
  149. * name: "Point2",
  150. * color: "#00FF00",
  151. * connectorWidth: 3,
  152. * connectorColor: "#FF00FF"
  153. * }, {
  154. * x: 1,
  155. * y: 6,
  156. * name: "Point1",
  157. * color: "#FF00FF"
  158. * }]
  159. * ```
  160. *
  161. * @sample {highcharts} highcharts/chart/reflow-true/
  162. * Numerical values
  163. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  164. * Arrays of numeric x and y
  165. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  166. * Arrays of datetime x and y
  167. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  168. * Arrays of point.name and y
  169. * @sample {highcharts} highcharts/series/data-array-of-objects/
  170. * Config objects
  171. *
  172. * @type {Array<number|Array<(number|string),(number|null)>|null|*>}
  173. * @extends series.dumbbell.data
  174. * @excluding high, low, lowColor
  175. * @product highcharts highstock
  176. * @apioption series.lollipop.data
  177. */
  178. /**
  179. * The y value of the point.
  180. *
  181. * @type {number|null}
  182. * @product highcharts highstock
  183. * @apioption series.line.data.y
  184. */
  185. ''; // adds doclets above to transpiled file
  186. });
  187. _registerModule(_modules, 'masters/modules/lollipop.src.js', [], function () {
  188. });
  189. }));