Reputation: 1419
Hi I've got a basic chart that isn't showing in IE 8 or 9. Works in IE 10. The space is just blank. Here's the code:
var colors = ['#C02942', '#53777A', '#ECD078', '#542437', '#D95B43'];
var data = google.visualization.arrayToDataTable([['Month', 'Clicked','Delivered','Sent'],['12/11', 0,0,0],['1/12', 1,1,1],['2/12', 0,0,1],['3/12', 0,0,0],['4/12', 0,0,0],['5/12', 0,0,1],['6/12', 0,0,2],['7/12', 0,0,0],['8/12', 0,0,2],['9/12', 0,0,0],['10/12', 0,0,0],['11/12', 0,0,0],['12/12', 0,0,0],['1/13', 0,0,0],['2/13', 0,0,0],['3/13', 0,0,1],['4/13', 0,0,0],['5/13', 0,0,3],['6/13', 0,0,0]]);
var options = {
width: 650,
colors: colors,
chartArea: { left: 50, top: 20},
hAxis: {showTextEvery: 2},
isStacked: true
};
chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
chart.draw(data, options);
TIA
Upvotes: 0
Views: 3050
Reputation: 1419
Looks like the problem was with my google.setOnLoadCallback line. Since the script was loaded from an ajax call it was not firing in IE 8, just every other browser. The answer was to just call the 'drawChart' function directly, instead of wrapping it in the google.setOnLoadCallback.
Upvotes: 0
Reputation: 1394
I ran your code in IE9, and it's throwing an error in the JavaScript console (hit F12 to bring the console up). The error is 'colors not defined'. Unless you've defined colors someplace else, that's the error I'm seeing.
Upvotes: 2