scatterChart.tsx 922 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import type {Series} from 'sentry/types/echarts';
  2. import ScatterSeries from './series/scatterSeries';
  3. import type {BaseChartProps} from './baseChart';
  4. import BaseChart from './baseChart';
  5. export type ScatterChartSeries = Series;
  6. interface Props extends Omit<BaseChartProps, 'series'> {
  7. series: ScatterChartSeries[];
  8. }
  9. function ScatterChart({series, ...props}: Props) {
  10. return (
  11. <BaseChart
  12. {...props}
  13. xAxis={{
  14. // do not want the axis pointer when working with scatter charts
  15. axisPointer: {
  16. show: false,
  17. ...props.xAxis?.axisPointer,
  18. },
  19. ...props.xAxis,
  20. }}
  21. series={series.map(({seriesName, data, ...options}) =>
  22. ScatterSeries({
  23. name: seriesName,
  24. data: data.map(({name, value}) => [name, value]),
  25. ...options,
  26. animation: false,
  27. })
  28. )}
  29. />
  30. );
  31. }
  32. export default ScatterChart;