mirror of https://github.com/grafana/grafana.git
36 lines
908 B
TypeScript
36 lines
908 B
TypeScript
// Libraries
|
|
import _ from 'lodash';
|
|
import React, { PureComponent } from 'react';
|
|
import { colors } from '@grafana/ui';
|
|
|
|
// Components & Types
|
|
import { Graph, PanelProps, NullValueMode, processTimeSeries } from '@grafana/ui';
|
|
import { Options } from './types';
|
|
|
|
interface Props extends PanelProps<Options> {}
|
|
|
|
export class GraphPanel extends PureComponent<Props> {
|
|
render() {
|
|
const { timeSeries, timeRange, width, height } = this.props;
|
|
const { showLines, showBars, showPoints } = this.props.options;
|
|
|
|
const vmSeries = processTimeSeries({
|
|
timeSeries: timeSeries,
|
|
nullValueMode: NullValueMode.Ignore,
|
|
colorPalette: colors,
|
|
});
|
|
|
|
return (
|
|
<Graph
|
|
timeSeries={vmSeries}
|
|
timeRange={timeRange}
|
|
showLines={showLines}
|
|
showPoints={showPoints}
|
|
showBars={showBars}
|
|
width={width}
|
|
height={height}
|
|
/>
|
|
);
|
|
}
|
|
}
|