From bc54d9777d53dd6c916d8c01e50c5dc2ac755e7b Mon Sep 17 00:00:00 2001 From: jamespcole Date: Sat, 4 Apr 2015 17:21:15 +1100 Subject: [PATCH] refactored line graph code --- .../www_static/polymer/components/state-timeline.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html b/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html index fca7528d7e5..a46d8596144 100644 --- a/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html +++ b/homeassistant/components/frontend/www_static/polymer/components/state-timeline.html @@ -124,6 +124,10 @@ isSingleDevice = true; } + while (this.$.line_graphs.firstChild) { + this.$.line_graphs.removeChild(this.$.line_graphs.firstChild); + } + for (var key in lineChartDevices) { var deviceStates = lineChartDevices[key]; @@ -142,9 +146,6 @@ var dataTable = new google.visualization.DataTable(); dataTable.addColumn({ type: 'datetime', id: 'Time' }); - //dataTable.addColumn({ type: 'number', id: 'Value' }); - - var options = { legend: { position: 'top' }, @@ -155,6 +156,7 @@ hAxis: { format: 'H:mm' } + ,width: '100%' }; if(isSingleDevice) {