deostroll deostroll - 1 year ago 182
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 Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download