mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 21:37:21 +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 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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user