AreaSplineSeries.js 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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 AreaSeries from '../Area/AreaSeries.js';
  25. var areaProto = AreaSeries.prototype;
  26. import SplineSeries from '../Spline/SplineSeries.js';
  27. import LegendSymbolMixin from '../../Mixins/LegendSymbol.js';
  28. import SeriesRegistry from '../../Core/Series/SeriesRegistry.js';
  29. import U from '../../Core/Utilities.js';
  30. var extend = U.extend, merge = U.merge;
  31. /* *
  32. *
  33. * Class
  34. *
  35. * */
  36. /**
  37. * AreaSpline series type.
  38. *
  39. * @private
  40. * @class
  41. * @name Highcharts.seriesTypes.areaspline
  42. *
  43. * @augments Highcharts.Series
  44. */
  45. var AreaSplineSeries = /** @class */ (function (_super) {
  46. __extends(AreaSplineSeries, _super);
  47. function AreaSplineSeries() {
  48. /* *
  49. *
  50. * Static properties
  51. *
  52. * */
  53. var _this = _super !== null && _super.apply(this, arguments) || this;
  54. /* *
  55. *
  56. * Properties
  57. *
  58. * */
  59. _this.data = void 0;
  60. _this.points = void 0;
  61. _this.options = void 0;
  62. return _this;
  63. }
  64. /**
  65. * The area spline series is an area series where the graph between the
  66. * points is smoothed into a spline.
  67. *
  68. * @sample {highcharts} highcharts/demo/areaspline/
  69. * Area spline chart
  70. * @sample {highstock} stock/demo/areaspline/
  71. * Area spline chart
  72. *
  73. * @extends plotOptions.area
  74. * @excluding step, boostThreshold, boostBlending
  75. * @product highcharts highstock
  76. * @apioption plotOptions.areaspline
  77. */
  78. /**
  79. * @see [fillColor](#plotOptions.areaspline.fillColor)
  80. * @see [fillOpacity](#plotOptions.areaspline.fillOpacity)
  81. *
  82. * @apioption plotOptions.areaspline.color
  83. */
  84. /**
  85. * @see [color](#plotOptions.areaspline.color)
  86. * @see [fillOpacity](#plotOptions.areaspline.fillOpacity)
  87. *
  88. * @apioption plotOptions.areaspline.fillColor
  89. */
  90. /**
  91. * @see [color](#plotOptions.areaspline.color)
  92. * @see [fillColor](#plotOptions.areaspline.fillColor)
  93. *
  94. * @default {highcharts} 0.75
  95. * @default {highstock} 0.75
  96. * @apioption plotOptions.areaspline.fillOpacity
  97. */
  98. AreaSplineSeries.defaultOptions = merge(SplineSeries.defaultOptions, AreaSeries.defaultOptions);
  99. return AreaSplineSeries;
  100. }(SplineSeries));
  101. extend(AreaSplineSeries.prototype, {
  102. getGraphPath: areaProto.getGraphPath,
  103. getStackPoints: areaProto.getStackPoints,
  104. drawGraph: areaProto.drawGraph,
  105. drawLegendSymbol: LegendSymbolMixin.drawRectangle
  106. });
  107. SeriesRegistry.registerSeriesType('areaspline', AreaSplineSeries);
  108. /* *
  109. *
  110. * Default export
  111. *
  112. * */
  113. export default AreaSplineSeries;
  114. /**
  115. * A `areaspline` series. If the [type](#series.areaspline.type) option
  116. * is not specified, it is inherited from [chart.type](#chart.type).
  117. *
  118. *
  119. * @extends series,plotOptions.areaspline
  120. * @excluding dataParser, dataURL, step, boostThreshold, boostBlending
  121. * @product highcharts highstock
  122. * @apioption series.areaspline
  123. */
  124. /**
  125. * @see [fillColor](#series.areaspline.fillColor)
  126. * @see [fillOpacity](#series.areaspline.fillOpacity)
  127. *
  128. * @apioption series.areaspline.color
  129. */
  130. /**
  131. * An array of data points for the series. For the `areaspline` series
  132. * type, points can be given in the following ways:
  133. *
  134. * 1. An array of numerical values. In this case, the numerical values will be
  135. * interpreted as `y` options. The `x` values will be automatically
  136. * calculated, either starting at 0 and incremented by 1, or from
  137. * `pointStart` and `pointInterval` given in the series options. If the axis
  138. * has categories, these will be used. Example:
  139. * ```js
  140. * data: [0, 5, 3, 5]
  141. * ```
  142. *
  143. * 2. An array of arrays with 2 values. In this case, the values correspond to
  144. * `x,y`. If the first value is a string, it is applied as the name of the
  145. * point, and the `x` value is inferred.
  146. * ```js
  147. * data: [
  148. * [0, 10],
  149. * [1, 9],
  150. * [2, 3]
  151. * ]
  152. * ```
  153. *
  154. * 3. An array of objects with named values. The following snippet shows only a
  155. * few settings, see the complete options set below. If the total number of
  156. * data points exceeds the series'
  157. * [turboThreshold](#series.areaspline.turboThreshold), this option is not
  158. * available.
  159. * ```js
  160. * data: [{
  161. * x: 1,
  162. * y: 4,
  163. * name: "Point2",
  164. * color: "#00FF00"
  165. * }, {
  166. * x: 1,
  167. * y: 4,
  168. * name: "Point1",
  169. * color: "#FF00FF"
  170. * }]
  171. * ```
  172. *
  173. * @sample {highcharts} highcharts/chart/reflow-true/
  174. * Numerical values
  175. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  176. * Arrays of numeric x and y
  177. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  178. * Arrays of datetime x and y
  179. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  180. * Arrays of point.name and y
  181. * @sample {highcharts} highcharts/series/data-array-of-objects/
  182. * Config objects
  183. *
  184. * @type {Array<number|Array<(number|string),(number|null)>|null|*>}
  185. * @extends series.line.data
  186. * @product highcharts highstock
  187. * @apioption series.areaspline.data
  188. */
  189. /**
  190. * @see [color](#series.areaspline.color)
  191. * @see [fillOpacity](#series.areaspline.fillOpacity)
  192. *
  193. * @apioption series.areaspline.fillColor
  194. */
  195. /**
  196. * @see [color](#series.areaspline.color)
  197. * @see [fillColor](#series.areaspline.fillColor)
  198. *
  199. * @default {highcharts} 0.75
  200. * @default {highstock} 0.75
  201. * @apioption series.areaspline.fillOpacity
  202. */
  203. ''; // adds doclets above into transpilat