stock.src.d.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*!*
  2. *
  3. * Copyright (c) Highsoft AS. All rights reserved.
  4. *
  5. *!*/
  6. import * as globals from "../globals.src";
  7. import * as _Highcharts from "../highcharts.src";
  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.src" {
  16. interface Axis {
  17. /**
  18. * Highstock only. Set the compare mode on all series belonging to an Y
  19. * 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) Highstock only. Force data grouping on all the axis'
  32. * 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. * Highstock only. Set the compare mode of the series after render time.
  47. * In most cases it is more useful running Axis#setCompare on the X axis
  48. * 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. * Factory function for creating new stock charts. Creates a new Chart
  57. * object with different default options than the basic Chart.
  58. *
  59. * @param options
  60. * The chart options structure as described in the options reference.
  61. *
  62. * @param callback
  63. * A function to execute when the chart object is finished loading
  64. * and rendering. In most cases the chart is built in one thread, but
  65. * in Internet Explorer version 8 or less the chart is sometimes
  66. * initialized before the document is ready, and in these cases the
  67. * chart object will not be finished synchronously. As a consequence,
  68. * code that relies on the newly built Chart object should always run
  69. * in the callback. Defining a chart.events.load handler is
  70. * equivalent.
  71. *
  72. * @return The chart object.
  73. */
  74. function stockChart(options: Options, callback?: ChartCallbackFunction): Chart;
  75. /**
  76. * Factory function for creating new stock charts. Creates a new Chart
  77. * object with different default options than the basic Chart.
  78. *
  79. * @param renderTo
  80. * The DOM element to render to, or its id.
  81. *
  82. * @param options
  83. * The chart options structure as described in the options reference.
  84. *
  85. * @param callback
  86. * A function to execute when the chart object is finished loading
  87. * and rendering. In most cases the chart is built in one thread, but
  88. * in Internet Explorer version 8 or less the chart is sometimes
  89. * initialized before the document is ready, and in these cases the
  90. * chart object will not be finished synchronously. As a consequence,
  91. * code that relies on the newly built Chart object should always run
  92. * in the callback. Defining a chart.events.load handler is
  93. * equivalent.
  94. *
  95. * @return The chart object.
  96. */
  97. function stockChart(renderTo: (string|HTMLDOMElement), options: Options, callback?: ChartCallbackFunction): Chart;
  98. /**
  99. * When we have vertical scrollbar, rifles and arrow in buttons should be
  100. * rotated. The same method is used in Navigator's handles, to rotate them.
  101. *
  102. * @param path
  103. * Path to be rotated.
  104. *
  105. * @param vertical
  106. * If vertical scrollbar, swap x-y values.
  107. *
  108. * @return Rotated path.
  109. */
  110. function swapXY(path: SVGPathArray, vertical?: boolean): SVGPathArray;
  111. }
  112. export default factory;
  113. export let Highcharts: typeof _Highcharts;