Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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! :)

like image 681
PinoyStackOverflower Avatar asked Jan 21 '26 18:01

PinoyStackOverflower


1 Answers

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

like image 115
Jamey Avatar answered Jan 24 '26 09:01

Jamey