mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Stat: Fixes an issue that could lead to browser crash with specific values (#40777)
This commit is contained in:
parent
dfeb69dc17
commit
80b4ef820a
@ -92,6 +92,15 @@ export class Sparkline extends PureComponent<SparklineProps, State> {
|
||||
getYRange(field: Field) {
|
||||
let { min, max } = this.state.alignedDataFrame.fields[1].state?.range!;
|
||||
|
||||
if (min === max) {
|
||||
if (min === 0) {
|
||||
max = 100;
|
||||
} else {
|
||||
min = 0;
|
||||
max! *= 2;
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
Math.max(min!, field.config.min ?? -Infinity),
|
||||
Math.min(max!, field.config.max ?? Infinity),
|
||||
|
Loading…
Reference in New Issue
Block a user