jquery - Flot graph not working, but not erroring -
so have flot running, graph axis etc draws, points not plotted.
for example code gets run (you can use js inspector on chrome , run code on http://www.flotcharts.org/flot/examples/series-types/index.html)
js:
$(document).ready(function() { $.plot('#placeholder',[ [0,0],[1, 25],[5, 2],[7, 165],[8, 520],[9, 962],[10, 123] ]); });
html:
<div id="placeholder" class="demo-placeholder"></div>
the code runs doesn't error - i'm not sure going wrong here?
i've ran same code on flot site , causes same issue.
p.s i'm trying jsfiddle this
you need wrap data in additional array, this:
$.plot('#placeholder', [[[0, 0], ...]]);
flot expects array of series, each series array of points. without outer array flot therefore interprets each of points own series data invalid. see data format section of docs more info.
Comments
Post a Comment