Column Chart problem with IE8

79 views
Skip to first unread message

Adam

unread,
Sep 2, 2009, 10:55:29 AM9/2/09
to Google Visualization API
I created an HTML page (see code below) with a column chart that works
fine in Chrome and Firefox.

However, in IE8 the chart renders ok but as soon as I move the mouse
cursor over one of the bars I get an 'object' is undefined error.

I can solve the problem by switching to IE compatibility view or
removing the DOCTYPE definition. But both these solutions are
temporary.

I would appreciate any guidance on this.
thanks,
Adam.


=====================================

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
google.load("visualization", "1", { packages:
["columnchart"] });
google.setOnLoadCallback(drawChart);

function drawChart() {
data = new google.visualization.DataTable();
data.addColumn('string', 'Weekday');
data.addColumn('number', 'sales');
data.addColumn('number', 'costs');
data.addRow(['Mon', 10, 1]);
data.addRow(['Tue', 20, 4]);
data.addRow(['Wed', 30, 9]);
data.addRow(['Thu', 40, 16]);
data.addRow(['Fri', 50, 25]);

var container = document.getElementById('chart_div');
chart = new google.visualization.ColumnChart(container);
chart.draw(data, { legend: 'bottom', is3D: true });
}
</script>
</head>
<body>
<div id="chart_div" style="width:600px; height:300px"></div>
</body>
</html>

Dieter Krachtus

unread,
Sep 2, 2009, 1:26:36 PM9/2/09
to Google Visualization API
This question was asked before a couple of times, for example here:

http://groups.google.com/group/google-visualization-api/browse_thread/thread/b3f3952959f31b35
http://groups.google.com/group/google-visualization-api/browse_thread/thread/89e07f28c968bded/73338d72645b311f?hl=en#73338d72645b311f

If I recall correctly I send a workaround which the viz team published
- but I don't find this post now. Bottomline: you need to change the
doctype for it to work in IE8.


Cheers,
Dieter

Adam

unread,
Sep 3, 2009, 4:39:52 AM9/3/09
to Google Visualization API
thanks for the reply.

Adam.

On Sep 2, 8:26 pm, Dieter Krachtus <dieter.krach...@googlemail.com>
wrote:
> This question was asked before a couple of times, for example here:
>
> http://groups.google.com/group/google-visualization-api/browse_thread...http://groups.google.com/group/google-visualization-api/browse_thread...
Reply all
Reply to author
Forward
0 new messages