responseCodeCountChart.tsx 869 B

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