简体   繁体   English

jQuery情节没有显示出来

[英]jQuery plot not showing up

I'm using jquery plugin called "Plot", I'm having problem using this one because it seems its not displaying any graph. 我正在使用名为“Plot”的jquery插件,我在使用这个时遇到了问题,因为它似乎没有显示任何图形。 I copy and pasted the code at http://jsfiddle.net/LDnUQ/ but unfortunately its not working. 我复制并粘贴了http://jsfiddle.net/LDnUQ/上的代码,但遗憾的是它无效。

Here's the code 这是代码

     <script>
            var plot = $.plot($("#flot_chart_<?= $char_iter; ?>"), [{ label: "Google Rank",  data: d}], options);
    var formateddata = [[1293840000000,332],[1293926400000,321],[1294012800000,310],[1294099200000,299],
[1294185600000,288],[1294272000000,277],[1294358400000,266],[1294444800000,255],
[1294531200000,244],[1294617600000,233],[1294704000000,222],[1294790400000,211],
[1294876800000,200],[1294963200000,189],[1295049600000,178],[1295136000000,167],
[1295222400000,156],[1295308800000,145],[1295395200000,134],[1295481600000,123],
[1295568000000,112],[1295654400000,101],[1295740800000,90],[1295827200000,79],
[1295913600000,68],[1296000000000,57],[1296086400000,46],[1296172800000,35],
[1296259200000,24],[1296345600000,13]];
jQuery.plot(jQuery("#placeholder"), [formateddata], { xaxis: { mode: "time" } });
</script>
        <div id="placeholder" style="width:300px;height:200px;"></div>

I know there are still javascript scripts that needs to embedded on my site, such as this one: 我知道仍然需要在我的网站上嵌入javascript脚本,例如:

<script type='text/javascript' src='mysite/js/flot/excanvas.js'></script>
<script type='text/javascript' src='mysite/js/flot/excanvas.js'></script>
<script type='text/javascript' src='mysite/js/flot/jquery.flot.js'></script>
<script type='text/javascript' src='mysite/js/flot/jquery.flot.resize.js'></script>
<script type='text/javascript' src='mysite/js/flot/jquery.flot.pie.js'></script>

I also have embeded the jquery script in my site, but still the flot plugin is still not working. 我也在我的网站中嵌入了jquery脚本,但仍然无法使用flot插件。 What's wrong with this? 这有什么问题? Maybe this is something that has been conflict with the other javascript scripts. 也许这是与其他JavaScript脚本冲突的东西。 Your help would be greatly appreciated and rewarded. 您的帮助将受到极大的赞赏和奖励。
Thanks! 谢谢! :) :)

The graph is present in Chrome. 该图表存在于Chrome中。 In IE you get "window.G_vmlCanvasManager is null or not an Object". 在IE中你得到“window.G_vmlCanvasManager为null或不是对象”。 Read this post about making it work with IE. 阅读这篇关于使其适用于IE的帖子。

http://code.google.com/p/flot/issues/detail?id=116 http://code.google.com/p/flot/issues/detail?id=116

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM