Google Charts: line chart: not displayed in IE and Firefox, but works in chrome

I have a simple diagram (albeit with a lot of data) that displays chrome perfectly but does not display in IE or Firefox. Since I know little about web development, I don’t know how to understand what is going wrong.

Can someone help me figure out what is wrong and maybe explain how they understood it?

<html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('datetime', 'Time'); data.addColumn('number', 'Amelias Room'); data.addColumn('number', 'board1'); data.addColumn('number', 'board2'); data.addColumn('number', 'Emersons Room'); data.addRows([ [new Date('2012-03-27 08:25:00'), 73,67,67,71], [new Date('2012-03-27 08:26:00'), 73,67,67,71], [new Date('2012-03-27 08:27:00'), 73,67,67,71], [new Date('2012-03-27 08:28:00'), 74,67,67,71], [new Date('2012-03-27 08:29:00'), 74,67,67,71], [new Date('2012-03-27 08:30:00'), 75,67,67,71], [new Date('2012-03-27 08:31:00'), 75,67,67,71], [new Date('2012-03-27 08:32:00'), 74,67,67,71], [new Date('2012-03-27 08:33:00'), 74,67,67,71], [new Date('2012-03-27 08:34:00'), 73,67,67,71], [new Date('2012-03-29 08:19:00'), 70.2244318181818,68.39375,67.8772727272728,71.0528409090909], [new Date('2012-03-29 08:20:00'), 70.1732954545455,68.45,67.8777173913044,71.0323863636363], [new Date('2012-03-29 08:21:00'), 70.1426136363637,68.4448863636364,67.83125,70.9607954545454], [new Date('2012-03-29 08:22:00'), 70.1375,68.3426136363637,67.775,70.9352272727273] ]); var options = { title: 'Temp Readings' }; var chart = new google.visualization.LineChart(document.getElementById('chart_div')); chart.draw(data, options); } </script> </head> <body> <div id="chart_div" style="width: 1024px; height: 768px;"></div> </body> </html> 
+7
source share
2 answers

Try changing the "-" to "/"

eg. [new Date('2012-03-27 08:25:00'), 73,67,67,71] to

 [new Date('2012/03/27 08:25:00'), 73,67,67,71] 

working on my IE9. :)

+10
source

From the documentation: Warning: you cannot simultaneously upload files with a line and wireframe on the same page.

So use this line: google.load("visualization", "1", {packages:["linechart"]});

This is where jsFiddle works:

http://jsfiddle.net/Steve_Wellens/X3UsB/

0
source

All Articles