admin管理员组

文章数量:1429475

How can I make transparent background in Google charts for Internet Explorer?

I have used

'backgroundColor':'transparent' and 'backgroundColor' = {fill: <color>};

It works in FF, Chrome, Safari, and Opera but did not work in Internet Explorer.

Is there any way to make it transparent in Internet Explorer?

How can I make transparent background in Google charts for Internet Explorer?

I have used

'backgroundColor':'transparent' and 'backgroundColor' = {fill: <color>};

It works in FF, Chrome, Safari, and Opera but did not work in Internet Explorer.

Is there any way to make it transparent in Internet Explorer?

Share Improve this question edited Jan 8, 2013 at 6:07 Thunder Rabbit 5,4878 gold badges46 silver badges82 bronze badges asked Jan 8, 2013 at 5:38 NagarajNagaraj 492 silver badges8 bronze badges 3
  • i am not sure but try backgroundColor: {stroke:null, fill:null, strokeSize: 0} and other would be adding blank png image as background – NullPoiиteя Commented Jan 8, 2013 at 5:46
  • Thank you very much ..for the reply...i have added 'backgroundColor':'#colorcode' same as the website bgcolor it works in all browsers thank you verymuch – Nagaraj Commented Jan 9, 2013 at 7:42
  • with pleasure...please do it.. – Nagaraj Commented Jan 10, 2013 at 8:53
Add a ment  | 

2 Answers 2

Reset to default 4

I had same problem, Internet Explorer 7,8 will display Chart on iframe, so i added jQuery to transparent background of body tag on Iframe use event Ready of Chart.

google.load("visualization", "1", {packages:["corechart"]});                                
                            google.setOnLoadCallback(drawChart);                                
                            function drawChart() {
                                var data = google.visualization.arrayToDataTable([
                                    ['', ''],
                                    ['', 2],
                                    ['', 8]
                                ]);

                                var options = {
                                    colors: ['#b28dc1', '#79449a'],
                                    legend: {position: 'none'},
                                    backgroundColor: 'transparent',
                                    pieSliceText: 'value',
                                    pieHole: 0.55,
                                    pieSliceBorderColor: 'none'
                                };

                                var chart = new google.visualization.PieChart(document.getElementById('chart1'));
                                google.visualization.events.addListener(chart, 'ready', addIETransparentBg);                                        
                                chart.draw(data, options);                                                                  
                            }
                            function addIETransparentBg(e) {
                                $("iframe").contents().find("body").css({'background': 'none'});
                            }

This can be done by either

backgroundColor: {stroke:null, fill:null, strokeSize: 0} // or
 backgroundColor:#colorcode ;

or you can add blank png image background to do this

本文标签: phpHow to make transparent background in google charts for internet explorerStack Overflow