Highcharts chart option backgroundColor:'trans

2019-01-17 09:14发布

Highcharts chart option backgroundColor:'transparent' showing black on 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 ?

7条回答
我想做一个坏孩纸
2楼-- · 2019-01-17 09:31

Try this solution:

histogram = new Highcharts.Chart({
                chart: { renderTo: 'histogram', defaultSeriesType: 'bar',
                         backgroundColor:'rgba(255, 255, 255, 0.0)'
                }
查看更多
Luminary・发光体
3楼-- · 2019-01-17 09:35

I found this in Highcharts sources:

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) + ')'

So you can set the chart background color to 'rgba(255,255,255,0.002)' and it runs in the most important browsers.

查看更多
beautiful°
4楼-- · 2019-01-17 09:36

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

查看更多
5楼-- · 2019-01-17 09:39
backgroundColor:'rgba(255, 255, 255, 0.0)',
查看更多
孤傲高冷的网名
6楼-- · 2019-01-17 09:43

May be you have to write

filter:0 !important;

in your css.

查看更多
欢心
7楼-- · 2019-01-17 09:44

Can you try this -

backgroundColor: null

See on: jsfiddle

查看更多
登录 后发表回答