diff --git a/app/client/log.js b/app/client/log.js index f712ba8..7e6be84 100644 --- a/app/client/log.js +++ b/app/client/log.js @@ -20,11 +20,11 @@ Template.log.events({ } }); - +var tempHolder = {}; var createChart = function() { - var self = this; + var self = tempHolder; self.labels = []; self.temperatures = []; Tracker.autorun(function() { @@ -41,6 +41,8 @@ var createChart = function() { }); }); + if(self.temperatures.length <= 0) { return; } /// there are no temperatures + // Get the context of the canvas element we want to select var chartCanvas = document.getElementById("temperatureChart");