deostroll deostroll - 4 months ago 20
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.

Answer

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.

Comments