Skip to content
This repository was archived by the owner on May 29, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions export-csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
lang: {
downloadCSV: 'Download CSV',
downloadXLS: 'Download XLS',
viewData: 'View data table'
viewData: 'View data table',
xTitleCategoryExport: 'Category', // used if xAxis is without title (Category axis)
xTitleDateTimeExport: 'DateTime', // used if xAxis is without title (DateTime axis)
xlsWorksheetName: 'Ark1'
}
});

Expand Down Expand Up @@ -114,7 +117,7 @@

// Add header row
if (!xTitle) {
xTitle = xAxis.isDatetimeAxis ? 'DateTime' : 'Category';
xTitle = xAxis.isDatetimeAxis ? Highcharts.getOptions().lang.xTitleDateTimeExport : Highcharts.getOptions().lang.xTitleCategoryExport;
}
dataRows = [[xTitle].concat(names)];

Expand Down Expand Up @@ -279,7 +282,7 @@
var uri = 'data:application/vnd.ms-excel;base64,',
template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">' +
'<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>' +
'<x:Name>Ark1</x:Name>' +
'<x:Name>' + Highcharts.getOptions().lang.xlsWorksheetName + '</x:Name>' +
'<x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->' +
'<style>td{border:none;font-family: Calibri, sans-serif;} .number{mso-number-format:"0.00";}</style>' +
'<meta name=ProgId content=Excel.Sheet>' +
Expand Down