开发者

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

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">
        $.开发者_如何学Pythonjqplot('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?


Replace your plotting script with this bit of code and see.

<SCRIPT LANGUAGE="JavaScript">
 $(function() { var plot1 = $.jqplot('chartdiv',  [[[1,2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]); })

</SCRIPT>

also check your .js files are in proper locations.


Got my answer from the jqPlot message board.

The div had to be before the call to jqPlot. I guess it makes sense but I just could not see it. My noob colors showing....


use following link path

<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/jqplot/1.0.8/jquery.jqplot.min.css" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜