File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1663,14 +1663,16 @@ Licensed under the MIT license.
1663
1663
// Grafana fix: wide Y min and max using increased wideFactor
1664
1664
// when all series values are the same
1665
1665
var wideFactor = 0.25 ;
1666
- var widen = max == 0 ? 1 : max * wideFactor ;
1666
+ var widen = Math . abs ( max == 0 ? 1 : max * wideFactor ) ;
1667
1667
1668
- if ( opts . min == null )
1669
- min -= widen ;
1668
+ if ( opts . min == null ) {
1669
+ min -= widen ;
1670
+ }
1670
1671
// always widen max if we couldn't widen min to ensure we
1671
1672
// don't fall into min == max which doesn't work
1672
- if ( opts . max == null || opts . min != null )
1673
- max += widen ;
1673
+ if ( opts . max == null || opts . min != null ) {
1674
+ max += widen ;
1675
+ }
1674
1676
}
1675
1677
else {
1676
1678
// consider autoscaling
You can’t perform that action at this time.
0 commit comments