Fixed wrong ID used for Weather forecast graphs (#223)

* Fixed wrong ID used for Weather forecast graphs

* Used static ID instead of entity_id computed one
This commit is contained in:
Tom Matheussen 2017-03-03 05:01:52 +01:00 committed by Paulus Schoutsen
parent 31b87075f9
commit fa0f91095d

View File

@ -21,7 +21,7 @@
<google-legacy-loader on-api-load='googleApiLoaded'></google-legacy-loader> <google-legacy-loader on-api-load='googleApiLoaded'></google-legacy-loader>
<ha-card header='[[computeTitle(stateObj)]]'> <ha-card header='[[computeTitle(stateObj)]]'>
<div class='content'> <div class='content'>
<div id$='[[computeChartId(stateObj)]]'></div> <div id='chart_id'></div>
<ha-attributes state-obj='[[stateObj]]' extra-filters='forecast'></ha-attributes> <ha-attributes state-obj='[[stateObj]]' extra-filters='forecast'></ha-attributes>
</div> </div>
</ha-card> </ha-card>
@ -50,10 +50,6 @@
return stateObj.attributes.friendly_name; return stateObj.attributes.friendly_name;
}, },
computeChartId: function (stateObj) {
return 'chart_area_' + stateObj.id;
},
getDataArray: function () { getDataArray: function () {
var dataArray = []; var dataArray = [];
var data = this.stateObj.attributes.forecast; var data = this.stateObj.attributes.forecast;
@ -84,7 +80,7 @@
if (!this.chartEngine) { if (!this.chartEngine) {
this.chartEngine = new window.google.visualization.LineChart( this.chartEngine = new window.google.visualization.LineChart(
document.getElementById(this.computeChartId(this.stateObj))); this.$.chart_id);
} }
this.drawChart(); this.drawChart();