Skip to content

Commit

Permalink
[frontend] Fix of #6174
Browse files Browse the repository at this point in the history
  • Loading branch information
Kedae committed Apr 17, 2024
1 parent 6d56673 commit 5e0be4d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ const ExportPopover = ({
const handleExportToCSV = () => {
setAnchorEl(null);
if (chartRef.current) {
chartRef.current.chart.ctx.exports.exportToCSV({ series });
const currentFormatter = chartRef.current.chart.opts.xaxis.labels.formatter;
if (currentFormatter) {
chartRef.current.chart.ctx.updateOptions({ xaxis: { labels: { formatter: (value) => value } } }, false, false, false);
chartRef.current.chart.ctx.exports.exportToCSV({ series });
chartRef.current.chart.ctx.updateOptions({ xaxis: { labels: { formatter: currentFormatter } } }, false);
} else {
chartRef.current.chart.ctx.exports.exportToCSV({ series });
}
}
};
return (
Expand Down

0 comments on commit 5e0be4d

Please sign in to comment.