diff --git a/index.html b/index.html index 45d850f..d190596 100644 --- a/index.html +++ b/index.html @@ -63,16 +63,18 @@ // Updating charts. var updatingChart = $(".updating-chart").peity("line", { width: 64 }) - setInterval(function() { - var random = Math.round(Math.random() * 10) - var values = updatingChart.text().split(",") - values.shift() - values.push(random) - - updatingChart - .text(values.join(",")) - .change() - }, 1000) + if (updatingChart.length > 0) { + setInterval(function() { + var random = Math.round(Math.random() * 10) + var values = updatingChart.text().split(",") + values.shift() + values.push(random) + + updatingChart + .text(values.join(",")) + .change() + }, 1000) + } })