Scatter Chart
Scatter and bubble chart with optional trendlines and size-mapped points.
Basic Usage
<ArcadiaScatterChart TItem="DataPoint" Data="@data"
XField="@(d => d.X)"
YField="@(d => d.Y)"
Height="300" Color="primary" />
Bubble Chart (Size-Mapped)
Add a SizeField to map a data dimension to point radius. Larger values render as bigger circles:
<ArcadiaScatterChart TItem="Company" Data="@companies"
XField="@(d => d.Revenue)"
YField="@(d => d.Growth)"
SizeField="@(d => d.Employees)"
Height="400" Width="0" Color="primary" PointSize="4"
Title="Revenue vs Growth (bubble = employees)" />
@code {
record Company(double Revenue, double Growth, double Employees);
List<Company> companies = new()
{
new(120, 15, 500), new(80, 25, 200),
new(200, 8, 1200), new(50, 30, 100),
};
}
With Trendline
<ArcadiaScatterChart Trendline="@(new TrendlineConfig { Type = TrendlineType.Linear })" ... />
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
XField | Func<T, double> | — | X value selector |
YField | Func<T, double> | — | Y value selector |
SizeField | Func<T, double>? | null | Bubble size selector |
PointSize | double | 5 | Default point radius |
PointOpacity | double | 0.7 | Opacity of data points (0.0 to 1.0) |
Color | string? | null | Point color |
XAxisLabel | string? | null | X-axis label text |
YAxisLabel | string? | null | Y-axis label text |
Trendline | TrendlineConfig? | null | Trendline config |
TrendlineOpacity | double | 0.6 | Opacity of the trendline (0.0 to 1.0) |
Plus all shared ChartBase parameters.
Events
| Event | Type | Description |
|---|---|---|
OnPointClick | EventCallback<PointClickEventArgs<T>> | Fired when a data point is clicked. Receives item, index, and series context |