export-data.src.d.ts 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 Chart {
  17. /**
  18. * Generates a data URL of CSV for local download in the browser. This
  19. * is the default action for a click on the 'Download CSV' button.
  20. *
  21. * See Highcharts.Chart#getCSV to get the CSV data itself.
  22. */
  23. downloadCSV(): void;
  24. /**
  25. * Generates a data URL of an XLS document for local download in the
  26. * browser. This is the default action for a click on the 'Download XLS'
  27. * button.
  28. *
  29. * See Highcharts.Chart#getTable to get the table data itself.
  30. */
  31. downloadXLS(): void;
  32. /**
  33. * Export-data module required. Returns the current chart data as a CSV
  34. * string.
  35. *
  36. * @param useLocalDecimalPoint
  37. * Whether to use the local decimal point as detected from the
  38. * browser. This makes it easier to export data to Excel in the
  39. * same locale as the user is.
  40. *
  41. * @return CSV representation of the data
  42. */
  43. getCSV(useLocalDecimalPoint?: boolean): string;
  44. /**
  45. * Export-data module required. Returns a two-dimensional array
  46. * containing the current chart data.
  47. *
  48. * @param multiLevelHeaders
  49. * Use multilevel headers for the rows by default. Adds an extra
  50. * row with top level headers. If a custom columnHeaderFormatter
  51. * is defined, this can override the behavior.
  52. *
  53. * @return The current chart data
  54. *
  55. * @fires Highcharts.Chart#exportData
  56. */
  57. getDataRows(multiLevelHeaders?: boolean): Array<Array<(number|string)>>;
  58. /**
  59. * Export-data module required. Build a HTML table with the chart's
  60. * current data.
  61. *
  62. * @param useLocalDecimalPoint
  63. * Whether to use the local decimal point as detected from the
  64. * browser. This makes it easier to export data to Excel in the
  65. * same locale as the user is.
  66. *
  67. * @return HTML representation of the data.
  68. *
  69. * @fires Highcharts.Chart#afterGetTable
  70. */
  71. getTable(useLocalDecimalPoint?: boolean): string;
  72. /**
  73. * Export-data module required. Hide the data table when visible.
  74. */
  75. hideData(): void;
  76. /**
  77. * Export-data module required. View the data in a table below the
  78. * chart.
  79. *
  80. * @fires Highcharts.Chart#afterViewData
  81. */
  82. viewData(): void;
  83. }
  84. }
  85. export default factory;
  86. export let Highcharts: typeof _Highcharts;