我已经实现了 ApexCharts 并希望将其输出到 PDF 文档中。
我尝试从 获取下载 URI chart.dataURI,但失败并出现错误:
Chart.dataURI 不是函数
下面是 Apex 条形图的创建以及我对下载 URI 的尝试,但它无法获取:
var options = {
chart: {
height: 450,
type: 'bar',
width: 1000,
},
plotOptions: {
bar: {
horizontal: false,
columnWidth: '40%',
endingShape: 'rounded'
},
},
dataLabels: {
enabled: false
},
colors: ['#008000', '#d4a823', '#f92525'],
stroke: {
show: true,
width: 2,
colors: ['transparent']
},
series: [{
name: 'Good',
data: JSON.stringify(graph_data.good)
}, {
name: 'Okey',
data: JSON.stringify(graph_data.ok)
}, {
name: 'Bad',
data: JSON.stringify(graph_data.bad)
}],
xaxis: …Run Code Online (Sandbox Code Playgroud)