CSS Highcharts 图表选项 backgroundColor:'transparent' 在 IE 8 上显示为黑色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7736385/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Highcharts chart option backgroundColor:'transparent' showing black on IE 8
提问by Nikshep
Highcharts
chart option backgroundColor:'transparent'
showing black on IE 8
Highcharts
图表选项backgroundColor:'transparent'
显示黑色IE 8
histogram = new Highcharts.Chart({
chart: { renderTo: 'histogram', defaultSeriesType: 'bar',
backgroundColor:'transparent'
}
This works fine on I.E 9
and others but fails on I.E 8 and Safari anyone has any idea why ?
这在I.E 9
和其他人上工作正常,但在 IE 8 和 Safari 上失败,有人知道为什么吗?
回答by Mayuresh
Try this solution:
试试这个解决方案:
histogram = new Highcharts.Chart({
chart: { renderTo: 'histogram', defaultSeriesType: 'bar',
backgroundColor:'rgba(255, 255, 255, 0.0)'
}
回答by nessa.gp
I found this in Highcharts sources:
我在 Highcharts 来源中发现了这一点:
Empirical lowest possible opacities for TRACKER_FILL
- IE6: 0.002
- IE7: 0.002
- IE8: 0.002
- IE9: 0.00000000001 (unlimited)
- IE10: 0.0001 (exporting only)
- FF: 0.00000000001 (unlimited)
- Chrome: 0.000001
- Safari: 0.000001
- Opera: 0.00000000001 (unlimited)
TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.0001 : 0.002) + ')'
TRACKER_FILL 的经验最低可能不透明度
- IE6:0.002
- IE7:0.002
- IE8:0.002
- IE9:0.00000000001(无限制)
- IE10:0.0001(仅导出)
- FF:0.00000000001(无限制)
- 铬:0.000001
- 野生动物园:0.000001
- 歌剧:0.00000000001(无限制)
TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.0001 : 0.002) + ')'
So you can set the chart background color to 'rgba(255,255,255,0.002)' and it runs in the most important browsers.
因此,您可以将图表背景颜色设置为“rgba(255,255,255,0.002)”,它可以在最重要的浏览器中运行。
回答by Attila Csányi
backgroundColor: 'transparent'
also working if you need type safety.
backgroundColor: 'transparent'
如果您需要类型安全,也可以使用。
回答by GrooveNow
If you can access the highcharts.js file go to the backgroundColor line (around 479) and change line like backgroundColor:"rgba(255, 255, 255, 0)"
. It will change all backgrounds of the charts to transparent
如果您可以访问 highcharts.js 文件,请转到 backgroundColor 行(大约 479)并更改行,如backgroundColor:"rgba(255, 255, 255, 0)"
. 它会将图表的所有背景更改为透明
回答by sandeep
May be you have to write
可能你必须写
filter:0 !important;
in your css.
在你的 css 中。
回答by Pankaj Upadhyay
backgroundColor:'rgba(255, 255, 255, 0.0)',