Thresholds: fix crash when trying to render zero-height base thresholds (#45256) (#45258)

(cherry picked from commit 586b89f776)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-02-10 19:00:44 +01:00
committed by GitHub
co-authored by Leon Sorokin
parent 843c1c71d9
commit c897372237
@@ -134,6 +134,10 @@ export function scaleGradient(u: uPlot, scaleKey: string, scaleStops: ScaleValue
let range = minStopPos - maxStopPos;
if (range === 0) {
return scaleStops[maxStopIdx!][1];
}
let x0, y0, x1, y1;
if (u.scales.x!.ori === ScaleOrientation.Horizontal) {