making jqplot work with IE8

4,030 views
Skip to first unread message

Vishal

unread,
Jun 2, 2010, 12:13:53 PM6/2/10
to jqplot-users
Hello,

Has anyone seen jqplot working with IE8. I am unable to make the
simplest example work with IE8 on a Windows Sever 2003 machine.

I have used excanvas.js provided with jqplot
I have used excanvas.js released latest from the project site on
google code.
I have used the meta tag to tell IE8 to emulate IE7, or use IE7
standards mode
I have tried using the IE8 quirks mode by not including any <!DOCTYPE>
tag.

Anything else left to be tried?

Any help would be highly appreciated.

Thanks and best regards,
Vishal Sapre

Vishal

unread,
Jun 2, 2010, 8:06:11 PM6/2/10
to jqplot-users
Hello,

I found there was a mistake in my initialization of jqplot.

as per the official help, only following is required to get a simple
plot going:

<!--[if IE]><script language="javascript" type="text/javascript"
src="excanvas.js"></script><![endif]-->
<script language="javascript" type="text/javascript"
src="jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript"
src="jquery.jqplot.min.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
<div id="chartdiv" style="height:400px;width:300px; "></div>
<script language="javascript" type="text/javascript">
$.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],
[11,219.9]]]);
</script>

This works in other browsers, however for some reason, this does not
work in IE, unless its wrapped up in the jquery document.ready()
function, like this:

<script language="javascript" type="text/javascript">
$(document).ready(function() {

$.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],
[11,219.9]]]);

});
</script>

so once we do this, it started working fine.

I am still not sure if this was the only thing that made it happen. If
I find some other changes which I have made to the source, will post
them here.
Reply all
Reply to author
Forward
0 new messages