谷歌图表(JS) - 有没有在图表上使用透明背景的方法? [英] Google Charts (JS) - is there a way of using a transparent background on a chart?
问题描述
我使用 Google图表API 将各种图表包含在一个web应用程序中,正在努力。我正在使用JavaScript图表工具( not 图像图表工具),并且想知道是否可以在图表上使用透明背景(例如线形图,饼图等)?
I'm using the Google Charts API to include various graphs on a webapp I'm working on. I'm using the javascript chart tools (not the image chart tools), and am wondering if it's possible to use a transparent background on a chart (e.g. line graph, pie chart, etc.)?
推荐答案
在图表的配置选项中,指定
In the Configuration Options of the chart, specify
backgroundColor: { fill:'transparent' }
Chrome和Firefox。
我花了一些时间来了解。 文档页面表示您只能放入HTML颜色字符串,而我假设透明不是其中之一。
This worked for me in Chrome and Firefox. It took me some time to find out. The doc page says you can only put in HTML color strings and I assumed 'transparent' was not one of them.
这篇关于谷歌图表(JS) - 有没有在图表上使用透明背景的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!