我需要帮助设置在Google Charts Calendar
上使用canvg
创建的画布对象的背景颜色。设置从Google Charts创建的透明画布/ png的背景颜色
这是JS Fiddle。
下载的图像/ PNG具有透明背景,因为画布具有这种方式。我想改变它,使它不再是透明的,但使用setAttribute
像这样white.I尝试:
canvas.setAttribute(
'style',
'position: absolute; ' +
'top: ' + (-chartArea.offsetHeight * 2) + 'px; ' +
'left: ' + (-chartArea.offsetWidth * 2) + 'px;' +
'backgroud-color: #fff;');
也使用这种方式:canvas.style.backgroundColor = 'blue';
但这些尝试都失败了,我一直没能找到一个好的工作答案。
非常感谢所有帮助。
我试图将[image/PNG](http://gyazo.com/9be86809a7802c7a04fd26d80a082d71)的背景从透明改为白色。对错误的蓝色抱歉。这是作为一个例子。 – shhasan 2014-10-22 15:42:19