jQuery 绘图未显示

发布于 2024-12-02 15:40:51 字数 1781 浏览 0 评论 0原文

我正在使用名为“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁与争疯 2024-12-09 15:40:51

该图存在于 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文