simple auto update

This commit is contained in:
Nils Schneider 2012-06-06 15:18:09 +02:00
parent ed938a2d64
commit ba14852b4b

View file

@ -18,6 +18,8 @@ var w = window.innerWidth - offset.left,
var cp = d3.select("#chart").append("div") var cp = d3.select("#chart").append("div")
.attr("id", "controlpanel") .attr("id", "controlpanel")
var updated_at = cp.append("p")
cp.append("button") cp.append("button")
.attr("class", "btn") .attr("class", "btn")
.attr("value", "reload") .attr("value", "reload")
@ -247,6 +249,8 @@ function reload() {
data = json data = json
updated_at.text(d3.time.format("%X")(new Date()))
update() update()
}) })
} }
@ -402,3 +406,5 @@ function update() {
} }
reload() reload()
var timer = window.setInterval(reload, 30000)