我正在尝试使用“白色”背景色导出图表。但总是以黑色为背景渲染(实际上我的页面/代码中没有黑色)。我不知道下载过程中黑色来自何处。有人可以帮忙吗。在下面附加“正在导出”标签
exporting: {
chartOptions: { // specific options for the exported image
plotOptions: {
series: {
dataLabels: {
enabled: true
}
},
chart: {
events: {
load: function () {
globalBackground = '#fff';
this.plotBackground.attr({
fill: globalBackground
});
}
}
}
}
},
fallbackToExportServer: false,
sourceWidth: 600,
sourceHeight: 400
}
Run Code Online (Sandbox Code Playgroud)
小智 5
可能您的图表backgroundColor = null。这意味着您的图表具有透明的背景。导出jpeg时,Highcharts将透明背景渲染为黑色。如果要在导出时更改颜色,请在导出对象中设置背景色。
exporting: {
chartOptions: {
chart: {
backgroundColor: '#9E9E9E'
}
}
}
Run Code Online (Sandbox Code Playgroud)