From 2485b7584c51bd178105fba6d0d21d99e3c4de1a Mon Sep 17 00:00:00 2001 From: Igor Babuschkin Date: Sat, 2 Aug 2014 15:14:44 +0200 Subject: [PATCH] Add clear method to Histogram --- js/histogram.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/histogram.js b/js/histogram.js index f9dacdc..cea4c01 100644 --- a/js/histogram.js +++ b/js/histogram.js @@ -109,5 +109,11 @@ function Histogram(ident) { draw_hist(ident, this.values.slice(0, this.counter+num)); this.counter += num; } + + this.clear = function() { + d3.select(ident).select("svg").remove(); + draw_hist(ident, []); + this.counter = 0; + } }