jQuery 绘图未显示
我正在使用名为“Plot”的 jquery 插件, 我在使用这个时遇到问题,因为它似乎没有显示任何图表。 我将代码复制并粘贴到 http://jsfiddle.net/LDnUQ/ 但不幸的是它不起作用。
这是代码,
<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>
我知道仍然有 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>
我也在我的网站中嵌入了 jquery 脚本,但 flot 插件仍然无法工作。这有什么问题吗?也许这与其他 javascript 脚本有冲突。 我们将非常感谢您的帮助并给予奖励。
谢谢! :)
I'm using jquery plugin called "Plot",
I'm having problem using this one because it seems its not displaying any graph.
I copy and pasted the code at http://jsfiddle.net/LDnUQ/ but unfortunately its not working.
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:
<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. What's wrong with this? Maybe this is something that has been conflict with the other javascript scripts.
Your help would be greatly appreciated and rewarded.
Thanks! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该图存在于 Chrome 中。在 IE 中,您会收到“window.G_vmlCanvasManager 为 null 或不是对象”。阅读这篇关于使其与 IE 一起使用的文章。
http://code.google.com/p/flot/issues/detail ?id=116
The graph is present in Chrome. In IE you get "window.G_vmlCanvasManager is null or not an Object". Read this post about making it work with IE.
http://code.google.com/p/flot/issues/detail?id=116