durationChart.tsx 966 B

123456789101112131415161718192021222324252627282930313233
  1. import type {Series} from 'sentry/types/echarts';
  2. import {AVG_COLOR} from 'sentry/views/insights/colors';
  3. import Chart, {ChartType} from 'sentry/views/insights/common/components/chart';
  4. import ChartPanel from 'sentry/views/insights/common/components/chartPanel';
  5. import {getDurationChartTitle} from 'sentry/views/insights/common/views/spans/types';
  6. import {CHART_HEIGHT} from 'sentry/views/insights/database/settings';
  7. interface Props {
  8. isLoading: boolean;
  9. series: Series[];
  10. error?: Error | null;
  11. }
  12. export function DurationChart({series, isLoading, error}: Props) {
  13. return (
  14. <ChartPanel title={getDurationChartTitle('db')}>
  15. <Chart
  16. height={CHART_HEIGHT}
  17. grid={{
  18. left: '0',
  19. right: '0',
  20. top: '8px',
  21. bottom: '0',
  22. }}
  23. data={series}
  24. loading={isLoading}
  25. error={error}
  26. chartColors={[AVG_COLOR]}
  27. type={ChartType.LINE}
  28. />
  29. </ChartPanel>
  30. );
  31. }