stock.d.ts 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*!*
  2. *
  3. * Copyright (c) Highsoft AS. All rights reserved.
  4. *
  5. *!*/
  6. import * as globals from "../globals";
  7. import * as _Highcharts from "../highcharts";
  8. /**
  9. * Adds the module to the imported Highcharts namespace.
  10. *
  11. * @param highcharts
  12. * The imported Highcharts namespace to extend.
  13. */
  14. export function factory(highcharts: typeof Highcharts): void;
  15. declare module "../highcharts" {
  16. interface Axis {
  17. /**
  18. * Highcharts Stock only. Set the compare mode on all series belonging
  19. * to an Y axis after render time.
  20. *
  21. * @param compare
  22. * The compare mode. Can be one of `null` (default), `"value"` or
  23. * `"percent"`.
  24. *
  25. * @param redraw
  26. * Whether to redraw the chart or to wait for a later call to
  27. * Chart#redraw.
  28. */
  29. setCompare(compare?: string, redraw?: boolean): void;
  30. /**
  31. * (Highstock) Highcharts Stock only. Force data grouping on all the
  32. * axis' series.
  33. *
  34. * @param dataGrouping
  35. * A `dataGrouping` configuration. Use `false` to disable data
  36. * grouping dynamically.
  37. *
  38. * @param redraw
  39. * Whether to redraw the chart or wait for a later call to
  40. * Chart#redraw.
  41. */
  42. setDataGrouping(dataGrouping?: (boolean|DataGroupingOptionsObject), redraw?: boolean): void;
  43. }
  44. interface Series {
  45. /**
  46. * Highcharts Stock only. Set the compare mode of the series after
  47. * render time. In most cases it is more useful running Axis#setCompare
  48. * on the X axis to update all its series.
  49. *
  50. * @param compare
  51. * Can be one of `null` (default), `"percent"` or `"value"`.
  52. */
  53. setCompare(compare?: string): void;
  54. }
  55. /**
  56. * Stock-optimized chart. Use Chart for common charts.
  57. */
  58. class StockChart extends Chart {
  59. /**
  60. * Initializes the chart. The constructor's arguments are passed on
  61. * directly.
  62. *
  63. * @param userOptions
  64. * Custom options.
  65. *
  66. * @param callback
  67. * Function to run when the chart has loaded and and all external
  68. * images are loaded.
  69. *
  70. * @fires Highcharts.StockChart#init
  71. * @fires Highcharts.StockChart#afterInit
  72. */
  73. init(userOptions: Options, callback?: Function): void;
  74. }
  75. /**
  76. * Factory function for creating new stock charts. Creates a new StockChart
  77. * object with different default options than the basic Chart.
  78. *
  79. * @param options
  80. * The chart options structure as described in the options reference.
  81. *
  82. * @param callback
  83. * A function to execute when the chart object is finished loading
  84. * and rendering. In most cases the chart is built in one thread, but
  85. * in Internet Explorer version 8 or less the chart is sometimes
  86. * initialized before the document is ready, and in these cases the
  87. * chart object will not be finished synchronously. As a consequence,
  88. * code that relies on the newly built Chart object should always run
  89. * in the callback. Defining a chart.events.load handler is
  90. * equivalent.
  91. *
  92. * @return The chart object.
  93. */
  94. function stockChart(options: Options, callback?: ChartCallbackFunction): StockChart;
  95. /**
  96. * Factory function for creating new stock charts. Creates a new StockChart
  97. * object with different default options than the basic Chart.
  98. *
  99. * @param renderTo
  100. * The DOM element to render to, or its id.
  101. *
  102. * @param options
  103. * The chart options structure as described in the options reference.
  104. *
  105. * @param callback
  106. * A function to execute when the chart object is finished loading
  107. * and rendering. In most cases the chart is built in one thread, but
  108. * in Internet Explorer version 8 or less the chart is sometimes
  109. * initialized before the document is ready, and in these cases the
  110. * chart object will not be finished synchronously. As a consequence,
  111. * code that relies on the newly built Chart object should always run
  112. * in the callback. Defining a chart.events.load handler is
  113. * equivalent.
  114. *
  115. * @return The chart object.
  116. */
  117. function stockChart(renderTo: (string|HTMLDOMElement), options: Options, callback?: ChartCallbackFunction): StockChart;
  118. /**
  119. * When we have vertical scrollbar, rifles and arrow in buttons should be
  120. * rotated. The same method is used in Navigator's handles, to rotate them.
  121. *
  122. * @param path
  123. * Path to be rotated.
  124. *
  125. * @param vertical
  126. * If vertical scrollbar, swap x-y values.
  127. *
  128. * @return Rotated path.
  129. */
  130. function swapXY(path: SVGPathArray, vertical?: boolean): SVGPathArray;
  131. /**
  132. * The symbol callbacks are generated on the SVGRenderer object in all
  133. * browsers. Even VML browsers need this in order to generate shapes in
  134. * export. Now share them with the VMLRenderer.
  135. */
  136. let Renderer: any;
  137. }
  138. export default factory;
  139. export let Highcharts: typeof _Highcharts;