AreaSplineSeries.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* *
  2. *
  3. * (c) 2010-2020 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. import H from '../Core/Globals.js';
  12. import LegendSymbolMixin from '../Mixins/LegendSymbol.js';
  13. import O from '../Core/Options.js';
  14. var defaultOptions = O.defaultOptions;
  15. import U from '../Core/Utilities.js';
  16. var seriesType = U.seriesType;
  17. import './AreaSeries.js';
  18. import './SplineSeries.js';
  19. var areaProto = H.seriesTypes.area.prototype;
  20. /**
  21. * AreaSpline series type.
  22. *
  23. * @private
  24. * @class
  25. * @name Highcharts.seriesTypes.areaspline
  26. *
  27. * @augments Highcharts.Series
  28. */
  29. seriesType('areaspline', 'spline',
  30. /**
  31. * The area spline series is an area series where the graph between the
  32. * points is smoothed into a spline.
  33. *
  34. * @sample {highcharts} highcharts/demo/areaspline/
  35. * Area spline chart
  36. * @sample {highstock} stock/demo/areaspline/
  37. * Area spline chart
  38. *
  39. * @extends plotOptions.area
  40. * @excluding step, boostThreshold, boostBlending
  41. * @product highcharts highstock
  42. * @apioption plotOptions.areaspline
  43. */
  44. defaultOptions.plotOptions.area, {
  45. getStackPoints: areaProto.getStackPoints,
  46. getGraphPath: areaProto.getGraphPath,
  47. drawGraph: areaProto.drawGraph,
  48. drawLegendSymbol: LegendSymbolMixin.drawRectangle
  49. });
  50. /**
  51. * A `areaspline` series. If the [type](#series.areaspline.type) option
  52. * is not specified, it is inherited from [chart.type](#chart.type).
  53. *
  54. *
  55. * @extends series,plotOptions.areaspline
  56. * @excluding dataParser, dataURL, step, boostThreshold, boostBlending
  57. * @product highcharts highstock
  58. * @apioption series.areaspline
  59. */
  60. /**
  61. * An array of data points for the series. For the `areaspline` series
  62. * type, points can be given in the following ways:
  63. *
  64. * 1. An array of numerical values. In this case, the numerical values will be
  65. * interpreted as `y` options. The `x` values will be automatically
  66. * calculated, either starting at 0 and incremented by 1, or from
  67. * `pointStart` and `pointInterval` given in the series options. If the axis
  68. * has categories, these will be used. Example:
  69. * ```js
  70. * data: [0, 5, 3, 5]
  71. * ```
  72. *
  73. * 2. An array of arrays with 2 values. In this case, the values correspond to
  74. * `x,y`. If the first value is a string, it is applied as the name of the
  75. * point, and the `x` value is inferred.
  76. * ```js
  77. * data: [
  78. * [0, 10],
  79. * [1, 9],
  80. * [2, 3]
  81. * ]
  82. * ```
  83. *
  84. * 3. An array of objects with named values. The following snippet shows only a
  85. * few settings, see the complete options set below. If the total number of
  86. * data points exceeds the series'
  87. * [turboThreshold](#series.areaspline.turboThreshold), this option is not
  88. * available.
  89. * ```js
  90. * data: [{
  91. * x: 1,
  92. * y: 4,
  93. * name: "Point2",
  94. * color: "#00FF00"
  95. * }, {
  96. * x: 1,
  97. * y: 4,
  98. * name: "Point1",
  99. * color: "#FF00FF"
  100. * }]
  101. * ```
  102. *
  103. * @sample {highcharts} highcharts/chart/reflow-true/
  104. * Numerical values
  105. * @sample {highcharts} highcharts/series/data-array-of-arrays/
  106. * Arrays of numeric x and y
  107. * @sample {highcharts} highcharts/series/data-array-of-arrays-datetime/
  108. * Arrays of datetime x and y
  109. * @sample {highcharts} highcharts/series/data-array-of-name-value/
  110. * Arrays of point.name and y
  111. * @sample {highcharts} highcharts/series/data-array-of-objects/
  112. * Config objects
  113. *
  114. * @type {Array<number|Array<(number|string),(number|null)>|null|*>}
  115. * @extends series.line.data
  116. * @product highcharts highstock
  117. * @apioption series.areaspline.data
  118. */
  119. ''; // adds doclets above into transpilat