AreaSplineSeries.js 3.5 KB

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