Files
2024-02-15 17:01:50 +00:00

38 lines
922 B
TypeScript

import type {Series} from 'sentry/types/echarts';
import ScatterSeries from './series/scatterSeries';
import type {BaseChartProps} from './baseChart';
import BaseChart from './baseChart';
export type ScatterChartSeries = Series;
interface Props extends Omit<BaseChartProps, 'series'> {
series: ScatterChartSeries[];
}
function ScatterChart({series, ...props}: Props) {
return (
<BaseChart
{...props}
xAxis={{
// do not want the axis pointer when working with scatter charts
axisPointer: {
show: false,
...props.xAxis?.axisPointer,
},
...props.xAxis,
}}
series={series.map(({seriesName, data, ...options}) =>
ScatterSeries({
name: seriesName,
data: data.map(({name, value}) => [name, value]),
...options,
animation: false,
})
)}
/>
);
}
export default ScatterChart;