Skip to content

Commit 94deebe

Browse files
author
Artur Pryka
authored
Merge pull request #218 from keen/apryka-csv-export
fix for missing file format
2 parents 7e4b0b4 + 9d7d4c2 commit 94deebe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/utils/export-data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ export default function exportData(obj) {
2424
}
2525

2626
const fileName = 'chart';
27-
let fileFormat = '';
27+
let fileFormat = supportedFormats[0];
2828
let content = '';
2929

3030
if (format === 'json') {
3131
content = `data:text/json;charset=utf-8, ${encodeURIComponent(JSON.stringify(data))}`;
32-
fileFormat = format;
3332
}
3433

3534
if (format === 'csv') {
3635
content = generateCsvContent(data);
36+
fileFormat = format;
3737
}
3838

3939
const htmlElement = document.createElement('a');

0 commit comments

Comments
 (0)