grafana/public/app/plugins/panel/gauge/GaugePanel.tsx

28 lines
669 B
TypeScript
Raw Normal View History

2019-01-09 10:00:10 -06:00
import React, { PureComponent } from 'react';
import { GaugeOptions, PanelProps, NullValueMode } from '@grafana/ui';
2019-01-09 10:00:10 -06:00
import { getTimeSeriesVMs } from 'app/viz/state/timeSeries';
import Gauge from 'app/viz/Gauge';
interface Props extends PanelProps<GaugeOptions> {}
2019-01-09 10:00:10 -06:00
export class GaugePanel extends PureComponent<Props> {
render() {
const { timeSeries, width, height } = this.props;
const vmSeries = getTimeSeriesVMs({
timeSeries: timeSeries,
nullValueMode: NullValueMode.Ignore,
});
return (
<Gauge
timeSeries={vmSeries}
{...this.props.options}
width={width}
height={height}
/>
);
2019-01-09 10:00:10 -06:00
}
}