mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Fix bug on TopN weird behavior with zero values (#74942)
This commit is contained in:
parent
ec5112b9cc
commit
458bf9fb0d
1 changed files with 3 additions and 1 deletions
|
@ -110,7 +110,9 @@ export class TopN extends Component {
|
|||
const isPositiveValue = lastValue >= 0;
|
||||
|
||||
const intervalLength = TopN.calcDomain(renderMode, min, max);
|
||||
const width = 100 * (Math.abs(lastValue) / intervalLength);
|
||||
// if both are 0, the division returns NaN causing unexpected behavior.
|
||||
// For this it defaults to 0
|
||||
const width = 100 * (Math.abs(lastValue) / intervalLength) || 0;
|
||||
|
||||
const styles = reactcss(
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue