diff --git a/lib/chart.js b/lib/chart.js index 7ee3efe1..4b55b420 100644 --- a/lib/chart.js +++ b/lib/chart.js @@ -163,7 +163,9 @@ export const batchExport = async (options) => { // Save the base64 from a buffer to a correct image file writeFileSync( info.options.export.outfile, - Buffer.from(info.result, 'base64') + info.options.export.type !== 'svg' + ? Buffer.from(info.result, 'base64') + : info.result ); } )