Javascript 将图表列表图表导出为pdf文档(jspdf)
我的情况是,我需要使用jspdf将图表输出到javascript生成的pdf文档中 我想转换显示在我的网站上的图表Javascript 将图表列表图表导出为pdf文档(jspdf),javascript,pdf,jspdf,chartist.js,Javascript,Pdf,Jspdf,Chartist.js,我的情况是,我需要使用jspdf将图表输出到javascript生成的pdf文档中 我想转换显示在我的网站上的图表 我正在使用ChartList进行此操作 有什么方法可以做到这一点吗?您可以查看jsPDF的addHTML函数,它应该为您提供画布的干净副本 const pdf = new jsPDF('p','pt','a4') const chartistChart = document.getElementById('your-chartist-chart') const previewPan
我正在使用ChartList进行此操作
有什么方法可以做到这一点吗?您可以查看jsPDF的addHTML函数,它应该为您提供画布的干净副本
const pdf = new jsPDF('p','pt','a4')
const chartistChart = document.getElementById('your-chartist-chart')
const previewPane = document.getElementById('preview-pane')
// addHTML is marked as deprecated, see links below for further information
pdf.addHTML(chartistChart, function() {
// Get the output pdf data URI
const outputString = pdf.output('datauristring')
// Changes the src to new data URI
previewPane.attr('src', outputString)
})
- Github上有关弃用和未来更改的问题