Overview
Scatter charts display data as individual points plotted on a coordinate system, making them ideal for showing correlations, distributions, and outliers in datasets with two or more variables.When to Use
Use scatter charts when you need to:- Show correlations or relationships between two variables
- Identify patterns, clusters, or outliers in data
- Display distributions across multiple dimensions
- Visualize large datasets with many data points
- Compare multiple data series on the same plot
Basic Configuration
The scatter chart is configured through theScatterSeriesOption interface, supporting multiple coordinate systems.
Complete Example
Key Options
The coordinate system to use. Scatter charts support multiple systems including:
'cartesian2d': 2D rectangular coordinate system (default)'polar': Polar coordinate system'geo': Geographic coordinate system'calendar': Calendar coordinate system'singleAxis': Single axis
Symbol type for data points. Options:
'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none', or a custom SVG path.Size of symbols. Can be a fixed number or a function that returns size based on data.
Rotation angle of symbols in degrees.
Visual style of scatter points.
Enable optimization for large-scale scatter data. When enabled, uses a more efficient rendering mode.
Threshold for switching to large mode. When data count exceeds this value, large mode is activated automatically.
Whether to clip overflow points outside the coordinate system. Works on cartesian and polar systems.
Label configuration for data points.
Visual emphasis when hovering over points.
Stack scatter points with the same stack value. Useful for accumulative scatter plots.
Data Format
Scatter chart data supports multiple formats:Advanced Features
Bubble Chart (Variable Size)
Color-Coded Scatter
Large-Scale Scatter (Performance Optimization)
Scatter on Polar Coordinates
Multi-Dimensional Scatter
Performance Tips
-
Enable large mode for datasets with more than 2,000 points:
-
Use progressive rendering for very large datasets:
-
Reduce symbol complexity for better performance:
Source Reference
The scatter chart implementation can be found in:- Series model:
src/chart/scatter/ScatterSeries.ts:84-169 - Default options:
src/chart/scatter/ScatterSeries.ts:128-165 - Type definitions:
src/chart/scatter/ScatterSeries.ts:47-81 - Dependencies:
src/chart/scatter/ScatterSeries.ts:88