responseCodeBarChart.tsx 1023 B

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