mirror of
https://github.com/home-assistant/frontend.git
synced 2026-02-04 01:10:33 -06:00
Handling empty history (#28852)
Co-authored-by: DAccord <11232265+DAccord@users.noreply.github.com>
This commit is contained in:
parent
3c5a6193d0
commit
303538ac21
@ -7,6 +7,11 @@ const calcPoints = (
|
||||
height: number,
|
||||
limits?: { minX?: number; maxX?: number; minY?: number; maxY?: number }
|
||||
) => {
|
||||
// handling empty history (for example unavailable for long time)
|
||||
if (history.length === 0) {
|
||||
return { points: [], yAxisOrigin: height };
|
||||
}
|
||||
|
||||
let yAxisOrigin = height;
|
||||
let minY = limits?.minY ?? history[0][1];
|
||||
let maxY = limits?.maxY ?? history[0][1];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user