GraphPanel.tsx 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Libraries
  2. import _ from 'lodash';
  3. import React, { PureComponent } from 'react';
  4. import colors from 'app/core/utils/colors';
  5. // Components & Types
  6. import { Graph, PanelProps, NullValueMode, processTimeSeries } from '@grafana/ui';
  7. import { Options } from './types';
  8. interface Props extends PanelProps<Options> {}
  9. export class GraphPanel extends PureComponent<Props> {
  10. constructor(props) {
  11. super(props);
  12. }
  13. render() {
  14. const { timeSeries, timeRange, width, height, onRenderError } = this.props;
  15. const { showLines, showBars, showPoints } = this.props.options;
  16. const vmSeries = processTimeSeries({
  17. timeSeries: timeSeries,
  18. nullValueMode: NullValueMode.Ignore,
  19. colorPalette: colors,
  20. });
  21. return (
  22. <Graph
  23. timeSeries={vmSeries}
  24. timeRange={timeRange}
  25. showLines={showLines}
  26. showPoints={showPoints}
  27. showBars={showBars}
  28. width={width}
  29. height={height}
  30. onRenderError={onRenderError}
  31. />
  32. );
  33. }
  34. }