The Generic Image Chart examples do not work!

10 views
Skip to first unread message

Dieter Krachtus

unread,
Dec 17, 2009, 5:18:43 AM12/17/09
to Google Visualization API
Hi,

perhaps it is just me but I just tried the example code from
http://code.google.com/apis/visualization/documentation/gallery/genericimagechart.html
and it didn't work.

Example:

<html>
<head>

<script type='text/javascript' src='http://www.google.com/jsapi'></
script>
<script type='text/javascript'>
google.load("visualization", "1.1", {packages:["imagechart"]});
google.setOnLoadCallback(drawChart);
</script>

<script type='text/javascript'>
function drawChart() {
var dataTable = new google.visualization.DataTable();
dataTable.addColumn('string');
dataTable.addColumn('number');
dataTable.addRows([
['DZ',0],
['EG',50],
['MG',50],
['GM',35],
['KE',100],
['ZA',100],
]);

var options = {cht: 't', chtm: 'africa', chco: 'FFFFFF,EEEEEE,
000000', chs: '440x220'};
var chart = new google.visualization.ImageChart
(document.getElementById('map_div'));
chart.draw(dataTable, options);
}
</script>

</head>

<body>
<div id='map_div'></div>
</body>

</html>

Bug Chart

unread,
Dec 22, 2009, 8:39:34 AM12/22/09
to google-visua...@googlegroups.com
Hi,

it looks like you have two problems:

1: use google.load("visualization", "1.0", {packages:["imagechart"]});
    instead of 1.1

2: move the google.setOnLoadCallback(drawChart);
    to the next <script> tag.

these are problems in our documentation,
and will be fixed soon.

HTH

BugChart.
Reply all
Reply to author
Forward
0 new messages