From aba33781ef142ca8cfd3381afb437cfff38753e2 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Wed, 24 May 2017 19:12:57 +0200 Subject: [PATCH] fixed temperatures hopefully --- app/client/log.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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");