Skip to content

Commit

Permalink
hash presence in csv export - fixes #2665
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Oct 30, 2021
1 parent 1c4d19b commit b2c51e5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/Exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ class Exports {

let columns = []
let rows = []
let result = 'data:text/csv;charset=utf-8,\uFEFF'
let result = ''
let universalBOM = '\uFEFF'

const isTimeStamp = (num) => {
return w.config.xaxis.type === 'datetime' && String(num).length >= 10
Expand Down Expand Up @@ -342,8 +343,10 @@ class Exports {

result += rows.join(lineDelimiter)

console.log(result, 'result')
this.triggerDownload(
encodeURI(result),
'data:text/csv; charset=utf-8,' +
encodeURIComponent(universalBOM + result),
w.config.chart.toolbar.export.csv.filename,
'.csv'
)
Expand Down

0 comments on commit b2c51e5

Please sign in to comment.