BarSeries.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /* *
  2. *
  3. * (c) 2010-2021 Torstein Honsi
  4. *
  5. * License: www.highcharts.com/license
  6. *
  7. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  8. *
  9. * */
  10. 'use strict';
  11. var __extends = (this && this.__extends) || (function () {
  12. var extendStatics = function (d, b) {
  13. extendStatics = Object.setPrototypeOf ||
  14. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16. return extendStatics(d, b);
  17. };
  18. return function (d, b) {
  19. extendStatics(d, b);
  20. function __() { this.constructor = d; }
  21. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  22. };
  23. })();
  24. import ColumnSeries from '../Column/ColumnSeries.js';
  25. import SeriesRegistry from '../../Core/Series/SeriesRegistry.js';
  26. import U from '../../Core/Utilities.js';
  27. var extend = U.extend, merge = U.merge;
  28. /* *
  29. *
  30. * Class
  31. *
  32. * */
  33. /**
  34. * Bar series type.
  35. *
  36. * @private
  37. * @class
  38. * @name Highcharts.seriesTypes.bar
  39. *
  40. * @augments Highcharts.Series
  41. */
  42. var BarSeries = /** @class */ (function (_super) {
  43. __extends(BarSeries, _super);
  44. function BarSeries() {
  45. /* *
  46. *
  47. * Static Properties
  48. *
  49. * */
  50. var _this = _super !== null && _super.apply(this, arguments) || this;
  51. /* *
  52. *
  53. * Properties
  54. *
  55. * */
  56. _this.data = void 0;
  57. _this.options = void 0;
  58. _this.points = void 0;
  59. return _this;
  60. }
  61. /**
  62. * A bar series is a special type of column series where the columns are
  63. * horizontal.
  64. *
  65. * @sample highcharts/demo/bar-basic/
  66. * Bar chart
  67. *
  68. * @extends plotOptions.column
  69. * @product highcharts
  70. * @optionparent plotOptions.bar
  71. */
  72. BarSeries.defaultOptions = merge(ColumnSeries.defaultOptions, {
  73. // nothing here yet
  74. });
  75. return BarSeries;
  76. }(ColumnSeries));
  77. extend(BarSeries.prototype, {
  78. inverted: true
  79. });
  80. SeriesRegistry.registerSeriesType('bar', BarSeries);
  81. /* *
  82. *
  83. * Default Export
  84. *
  85. * */
  86. export default BarSeries;
  87. /* *
  88. *
  89. * API Options
  90. *
  91. * */
  92. /**
  93. * A `bar` series. If the [type](#series.bar.type) option is not specified,
  94. * it is inherited from [chart.type](#chart.type).
  95. *
  96. * @extends series,plotOptions.bar
  97. * @excluding connectNulls, dashStyle, dataParser, dataURL, gapSize, gapUnit,
  98. * linecap, lineWidth, marker, connectEnds, step
  99. * @product highcharts
  100. * @apioption series.bar
  101. */
  102. /**
  103. * An array of data points for the series. For the `bar` series type,
  104. * points can be given in the following ways:
  105. *
  106. * 1. An array of numerical values. In this case, the numerical values will be
  107. * interpreted as `y` options. The `x` values will be automatically
  108. * calculated, either starting at 0 and incremented by 1, or from
  109. * `pointStart` and `pointInterval` given in the series options. If the axis
  110. * has categories, these will be used. Example:
  111. * ```js
  112. * data: [0, 5, 3, 5]
  113. * ```
  114. *
  115. * 2. An array of arrays with 2 values. In this case, the values correspond to
  116. * `x,y`. If the first value is a string, it is applied as the name of the
  117. * point, and the `x` value is inferred.
  118. * ```js
  119. * data: [
  120. * [0, 5],
  121. * [1, 10],
  122. * [2, 3]
  123. * ]
  124. * ```
  125. *
  126. * 3. An array of objects with named values. The following snippet shows only a
  127. * few settings, see the complete options set below. If the total number of
  128. * data points exceeds the series'
  129. * [turboThreshold](#series.bar.turboThreshold), this option is not
  130. * available.
  131. * ```js
  132. * data: [{
  133. * x: 1,
  134. * y: 1,
  135. * name: "Point2",
  136. * color: "#00FF00"
  137. * }, {
  138. * x: 1,
  139. * y: 10,
  140. * name: "Point1",
  141. * color: "#FF00FF"
  142. * }]
  143. * ```
  144. *
  145. * @sample {highcharts} highcharts/chart/reflow-true/
  146. * Numerical values
  147. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  148. * Arrays of numeric x and y
  149. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  150. * Arrays of datetime x and y
  151. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  152. * Arrays of point.name and y
  153. * @sample {highcharts} highcharts/series/data-array-of-objects/
  154. * Config objects
  155. *
  156. * @type {Array<number|Array<(number|string),(number|null)>|null|*>}
  157. * @extends series.column.data
  158. * @product highcharts
  159. * @apioption series.bar.data
  160. */
  161. /**
  162. * @excluding halo,lineWidth,lineWidthPlus,marker
  163. * @product highcharts highstock
  164. * @apioption series.bar.states.hover
  165. */
  166. /**
  167. * @excluding halo,lineWidth,lineWidthPlus,marker
  168. * @product highcharts highstock
  169. * @apioption series.bar.states.select
  170. */
  171. ''; // gets doclets above into transpilat