Skip to content

Commit

Permalink
Merge pull request #12087 from PatAKnight/OCPBUGSM-21236
Browse files Browse the repository at this point in the history
Bug 1904106: Fix Y-axis labels for minimal / no data
  • Loading branch information
openshift-merge-robot committed Sep 27, 2022
2 parents 58fc3fe + 44e241d commit 15b885d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/public/components/monitoring/query-browser.tsx
Expand Up @@ -372,7 +372,7 @@ const Graph: React.FC<GraphProps> = React.memo(
_.every(series, ([, values]) => _.every(values, { y: 0 })),
);
if (isAllZero) {
domain.y = [-1, 1];
domain.y = [0, 1];
}
} else {
// Set a reasonable Y-axis range based on the min and max values in the data
Expand All @@ -381,7 +381,7 @@ const Graph: React.FC<GraphProps> = React.memo(
let minY: number = findMin(data.map(findMin))?.y ?? 0;
let maxY: number = findMax(data.map(findMax))?.y ?? 0;
if (minY === 0 && maxY === 0) {
minY = -1;
minY = 0;
maxY = 1;
} else if (minY > 0 && maxY > 0) {
minY = 0;
Expand Down

0 comments on commit 15b885d

Please sign in to comment.