Skip to content

Commit

Permalink
Revert "Merge pull request openshift#5622 from rhamilto/bz1840543"
Browse files Browse the repository at this point in the history
This reverts commit 169bf18, reversing
changes made to 18b7916.
  • Loading branch information
rawagner committed Jun 1, 2020
1 parent 169bf18 commit f692810
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions frontend/public/components/graphs/gauge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import classNames from 'classnames';
import { PrometheusGraph, PrometheusGraphLink } from './prometheus-graph';
import { usePrometheusPoll } from './prometheus-poll-hook';
import { PrometheusEndpoint } from './helpers';
import { humanizePercentage, Humanize } from '../utils';
import { useRefWidth, humanizePercentage, Humanize } from '../utils';
import { getInstantVectorStats } from './utils';
import { DataPoint } from '.';

Expand All @@ -32,13 +32,24 @@ export const GaugeChart: React.FC<GaugeChartProps> = ({
secondaryTitle = usedLabel,
className,
}) => {
const [ref, width] = useRefWidth();
const ready = !error && !loading;
const status = loading ? 'Loading' : error;
const labels = ({ datum: { x, y } }) => (x ? `${x} ${usedLabel}` : `${y} ${remainderLabel}`);
return (
<PrometheusGraph className={classNames('graph-wrapper--title-center', className)} title={title}>
<PrometheusGraph
className={classNames('graph-wrapper--title-center graph-wrapper--gauge', className)}
ref={ref}
title={title}
>
<PrometheusGraphLink query={query}>
<ChartDonutThreshold data={thresholds} height={160} padding={0} width={160} y="value">
<ChartDonutThreshold
data={thresholds}
height={width} // Changes the scale of the graph, not actual width and height
padding={0}
width={width}
y="value"
>
<ChartDonutUtilization
labels={labels}
data={ready ? data : { y: 0 }}
Expand Down

0 comments on commit f692810

Please sign in to comment.