lollipop.src.js 7.3 KB

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