Why does this cause an error in IE?
Open the html doc below with IE; pull down the menu and hover over 2
but don't click it; now while 2 is highlighted click outside the
pulldown menu; it should close and keep "6" as it's value. Now pull
down the menu and click on "1".
You get:
Line: 495
Error: Failed
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
var globTopX=5;
google.load("visualization", "1", {packages:["columnchart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
if (globTopX==5){
data.addColumn('string', 'Year');
data.addColumn('number', 'Sales');
data.addColumn('number', 'Expenses');
data.addRows(4);
data.setValue(0, 0, '2004');
data.setValue(0, 1, 1000);
data.setValue(0, 2, 400);
data.setValue(1, 0, '2005');
data.setValue(1, 1, 1170);
data.setValue(1, 2, 460);
data.setValue(2, 0, '2006');
data.setValue(2, 1, 660);
data.setValue(2, 2, 1120);
data.setValue(3, 0, '2007');
data.setValue(3, 1, 1030);
data.setValue(3, 2, 540);
}
else {
data.addColumn('string', 'Year');
data.addColumn('number', 'Sales');
data.addRows(3);
data.setValue(0, 0, '2004');
data.setValue(0, 1, 1000);
data.setValue(1, 0, '2005');
data.setValue(1, 1, 1170);
data.setValue(2, 0, '2006');
data.setValue(2, 1, 660);
}
var chart = new
google.visualization.ColumnChart(document.getElementById('chart_div'));
chart.draw(data, {width: 400, height: 240, is3D: true, title:
'Company Performance'});
}
</script>
</head>
<body>
<FONT FACE="Arial" size="2">Show top:
<form name="form1"><select name="menu1"
onchange="globTopX=this.value;
document.getElementById('inner_div').innerHTML='selected:'+this.value;drawChart();"
>
<option value="all">all</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="5">5</option>
<option value="6" selected="SELECTED">6</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
</select></form>
<div id="chart_div"></div>
<div id="inner_div"> </div>
</body>
</html>
--
You received this message because you are subscribed to the Google Groups
"Google Chart API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-chart-api?hl=en.