mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-26 14:27:20 +00:00
Fix error when only one state history entry. (#1750)
This commit is contained in:
parent
a7ddbd72b3
commit
90c3350d40
@ -120,6 +120,8 @@ class HuiSensorCard extends EventsMixin(LitElement) {
|
|||||||
const min = Math.floor(Math.min.apply(null, values) * 0.95);
|
const min = Math.floor(Math.min.apply(null, values) * 0.95);
|
||||||
const max = Math.ceil(Math.max.apply(null, values) * 1.05);
|
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 yRatio = (max - min) / height;
|
||||||
const xRatio = width / (values.length - 1);
|
const xRatio = width / (values.length - 1);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user