GraphPanel.tsx 914 B

1234567891011121314151617181920212223242526272829303132333435
  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. render() {
  11. const { timeSeries, timeRange, width, height } = this.props;
  12. const { showLines, showBars, showPoints } = this.props.options;
  13. const vmSeries = processTimeSeries({
  14. timeSeries: timeSeries,
  15. nullValueMode: NullValueMode.Ignore,
  16. colorPalette: colors,
  17. });
  18. return (
  19. <Graph
  20. timeSeries={vmSeries}
  21. timeRange={timeRange}
  22. showLines={showLines}
  23. showPoints={showPoints}
  24. showBars={showBars}
  25. width={width}
  26. height={height}
  27. />
  28. );
  29. }
  30. }