Fix error when only one state history entry. (#1750)

This commit is contained in:
Jerad Meisner 2018-10-09 02:12:04 -07:00 committed by Paulus Schoutsen
parent a7ddbd72b3
commit 90c3350d40

View File

@ -120,6 +120,8 @@ class HuiSensorCard extends EventsMixin(LitElement) {
const min = Math.floor(Math.min.apply(null, values) * 0.95);
const max = Math.ceil(Math.max.apply(null, values) * 1.05);
if (values.length === 1) values.push(values[0]);
const yRatio = (max - min) / height;
const xRatio = width / (values.length - 1);