Hey Guys, does anyone know how to reload a flot graph in javascript? For instance, I want to redraw the graph every time an input value is changed. I tried experimenting with a few methods found in the flot API, such as draw() and setupGrid() without any luck.
Here's some example code:
$("#some_input_box").change(function(){
plot.draw(); // redraw graph
});
You are on the right track with
draw
andsetupGrid
, here's what you need to do:Alternatively, it's not too much worse to just re-call
$.plot
. The above way is more efficient, but...