I am trying to get a simple jqplot example going but it will not display, why not?

1,872 views
Skip to first unread message

stephenmm

unread,
Jun 13, 2010, 6:51:00 PM6/13/10
to jqplot-users
Here is the entire contents of the file:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
<title>jqPlot Examples</title>

<!--[if IE]><script language="javascript" type="text/javascript"
src="excanvas.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="../
jqtouch-1_0_b/jqtouch/jquery.1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="../
javascript/jquery.jqplot.min.js"></script>
<link rel="stylesheet" type="text/css" href="../javascript/
jquery.jqplot.css" />
</head>
<body>
<h1>jqPlot Examples</h1>

<script id="source" 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>

div<br>
<div id="chartdiv" style="height:400px;width:300px; "></div>
div<br>


</body>
</html>
<html>

Here is what I see in FF, chrome, IE:

jqPlot Examples

div

div

I am seeing no errors in my Apache error log. I know all the .js files
are accessible from the html. Does anyone have an idea about why this
might not be working?

v0idnull

unread,
Jun 15, 2010, 12:25:10 AM6/15/10
to jqplot...@googlegroups.com
But the <div id="chartdiv"> bit, BEFORE the <script id="source"> bit.
$.jqplot is loading immediately, and thus, it's loading before the div
does, and it fails.

$(window).load(function(e)
{
$.jqplot('chartdiv',[[your points]]);
});

Might work as well. Not sure if that's 100% correct, but it's a window
onload event so the chart will load when the window is ready

--llundi0v

Reply all
Reply to author
Forward
0 new messages