deostroll deostroll - 8 months ago 99
Javascript Question

JQuery Flot: clear graph

Is there a recommended way to clear a jQuery Flot graph? I couldn't find anything the in the API reference.


By "clear" do you mean "nuke the entire graph," or just clear the data?

To nuke the entire graph: $('#canvas_id').empty();

To clear the data, just call the usual $.plot(placeholder, data, options); where data is empty.