-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
ExportDataDefaults.ts
331 lines (298 loc) · 8.51 KB
/
ExportDataDefaults.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
/* *
*
* Experimental data export module for Highcharts
*
* (c) 2010-2024 Torstein Honsi
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
'use strict';
/* *
*
* Imports
*
* */
import type {
ExportingOptions,
LangOptions
} from './ExportDataOptions';
/* *
*
* Constants
*
* */
/**
* @optionparent exporting
* @private
*/
const exporting: ExportingOptions = {
/**
* Caption for the data table. Same as chart title by default. Set to
* `false` to disable.
*
* @sample highcharts/export-data/multilevel-table
* Multiple table headers
*
* @type {boolean|string}
* @since 6.0.4
* @requires modules/export-data
* @apioption exporting.tableCaption
*/
/**
* Options for exporting data to CSV or ExCel, or displaying the data
* in a HTML table or a JavaScript structure.
*
* This module adds data export options to the export menu and provides
* functions like `Chart.getCSV`, `Chart.getTable`, `Chart.getDataRows`
* and `Chart.viewData`.
*
* The XLS converter is limited and only creates a HTML string that is
* passed for download, which works but creates a warning before
* opening. The workaround for this is to use a third party XLSX
* converter, as demonstrated in the sample below.
*
* @sample highcharts/export-data/categorized/ Categorized data
* @sample highcharts/export-data/stock-timeaxis/ Highcharts Stock time axis
* @sample highcharts/export-data/xlsx/
* Using a third party XLSX converter
*
* @since 6.0.0
* @requires modules/export-data
*/
csv: {
/**
*
* Options for annotations in the export-data table.
*
* @since 8.2.0
* @requires modules/export-data
* @requires modules/annotations
*
*
*/
annotations: {
/**
* The way to mark the separator for annotations
* combined in one export-data table cell.
*
* @since 8.2.0
* @requires modules/annotations
*/
itemDelimiter: '; ',
/**
* When several labels are assigned to a specific point,
* they will be displayed in one field in the table.
*
* @sample highcharts/export-data/join-annotations/
* Concatenate point annotations with itemDelimiter set.
*
* @since 8.2.0
* @requires modules/annotations
*/
join: false
},
/**
* Formatter callback for the column headers. Parameters are:
* - `item` - The series or axis object)
* - `key` - The point key, for example y or z
* - `keyLength` - The amount of value keys for this item, for
* example a range series has the keys `low` and `high` so the
* key length is 2.
*
* If [useMultiLevelHeaders](#exporting.useMultiLevelHeaders) is
* true, columnHeaderFormatter by default returns an object with
* columnTitle and topLevelColumnTitle for each key. Columns with
* the same topLevelColumnTitle have their titles merged into a
* single cell with colspan for table/Excel export.
*
* If `useMultiLevelHeaders` is false, or for CSV export, it returns
* the series name, followed by the key if there is more than one
* key.
*
* For the axis it returns the axis title or "Category" or
* "DateTime" by default.
*
* Return `false` to use Highcharts' proposed header.
*
* @sample highcharts/export-data/multilevel-table
* Multiple table headers
*
* @type {Function|null}
*/
columnHeaderFormatter: null,
/**
* Which date format to use for exported dates on a datetime X axis.
* See `Highcharts.dateFormat`.
*/
dateFormat: '%Y-%m-%d %H:%M:%S',
/**
* Which decimal point to use for exported CSV. Defaults to the same
* as the browser locale, typically `.` (English) or `,` (German,
* French etc).
*
* @type {string|null}
* @since 6.0.4
*/
decimalPoint: null,
/**
* The item delimiter in the exported data. Use `;` for direct
* exporting to Excel. Defaults to a best guess based on the browser
* locale. If the locale _decimal point_ is `,`, the `itemDelimiter`
* defaults to `;`, otherwise the `itemDelimiter` defaults to `,`.
*
* @type {string|null}
*/
itemDelimiter: null,
/**
* The line delimiter in the exported data, defaults to a newline.
*/
lineDelimiter: '\n'
},
/**
* Show a HTML table below the chart with the chart's current data.
*
* @sample highcharts/export-data/showtable/
* Show the table
* @sample highcharts/studies/exporting-table-html
* Experiment with putting the table inside the subtitle to
* allow exporting it.
*
* @since 6.0.0
* @requires modules/export-data
*/
showTable: false,
/**
* Use multi level headers in data table. If [csv.columnHeaderFormatter
* ](#exporting.csv.columnHeaderFormatter) is defined, it has to return
* objects in order for multi level headers to work.
*
* @sample highcharts/export-data/multilevel-table
* Multiple table headers
*
* @since 6.0.4
* @requires modules/export-data
*/
useMultiLevelHeaders: true,
/**
* If using multi level table headers, use rowspans for headers that
* have only one level.
*
* @sample highcharts/export-data/multilevel-table
* Multiple table headers
*
* @since 6.0.4
* @requires modules/export-data
*/
useRowspanHeaders: true,
/**
* Display a message when export is in progress.
* Uses [Chart.setLoading()](/class-reference/Highcharts.Chart#setLoading)
*
* The message can be altered by changing [](#lang.exporting.exportInProgress)
*
* @since 11.3.0
* @requires modules/export-data
*/
showExportInProgress: true
};
/**
* @optionparent lang
* @private
*/
const lang: LangOptions = {
/**
* The text for the menu item.
*
* @since 6.0.0
* @requires modules/export-data
*/
downloadCSV: 'Download CSV',
/**
* The text for the menu item.
*
* @since 6.0.0
* @requires modules/export-data
*/
downloadXLS: 'Download XLS',
/**
* The text for exported table.
*
* @since 8.1.0
* @requires modules/export-data
*/
exportData: {
/**
* The annotation column title.
*/
annotationHeader: 'Annotations',
/**
* The category column title.
*/
categoryHeader: 'Category',
/**
* The category column title when axis type set to "datetime".
*/
categoryDatetimeHeader: 'DateTime'
},
/**
* The text for the menu item.
*
* @since 6.0.0
* @requires modules/export-data
*/
viewData: 'View data table',
/**
* The text for the menu item.
*
* @since 8.2.0
* @requires modules/export-data
*/
hideData: 'Hide data table',
/**
* Text to show when export is in progress.
*
* @since 11.3.0
* @requires modules/export-data
*/
exportInProgress: 'Exporting...'
};
/* *
*
* Default Export
*
* */
const ExportDataDefaults = {
exporting,
lang
};
export default ExportDataDefaults;
/* *
*
* API Options
*
* */
/**
* Callback that fires while exporting data. This allows the modification of
* data rows before processed into the final format.
*
* @type {Highcharts.ExportDataCallbackFunction}
* @context Highcharts.Chart
* @requires modules/export-data
* @apioption chart.events.exportData
*/
/**
* When set to `false` will prevent the series data from being included in
* any form of data export.
*
* Since version 6.0.0 until 7.1.0 the option was existing undocumented
* as `includeInCSVExport`.
*
* @type {boolean}
* @since 7.1.0
* @requires modules/export-data
* @apioption plotOptions.series.includeInDataExport
*/
(''); // keep doclets above in JS file