|
@@ -844,7 +844,9 @@ export default {
|
|
|
// 查找class为'background'的rect元素并修改fill属性
|
|
|
let rectElement = svgDoc.querySelector('rect.highcharts-plot-background');
|
|
|
if (rectElement) {
|
|
|
- rectElement.setAttribute('fill', plotBackgroundColor);
|
|
|
+ //transparent(生成的图表背景会变黑) -> rgba(255, 255, 255, 0)
|
|
|
+ let currentColor = plotBackgroundColor==='transparent'?'rgba(255, 255, 255, 0)':plotBackgroundColor
|
|
|
+ rectElement.setAttribute('fill', currentColor);
|
|
|
}
|
|
|
// 将修改后的SVG文档转换回字符串
|
|
|
let serializer = new XMLSerializer();
|