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

ParameterTypeDefaultDescription
XFieldFunc<T, double>X value selector
YFieldFunc<T, double>Y value selector
SizeFieldFunc<T, double>?nullBubble size selector
PointSizedouble5Default point radius
PointOpacitydouble0.7Opacity of data points (0.0 to 1.0)
Colorstring?nullPoint color
XAxisLabelstring?nullX-axis label text
YAxisLabelstring?nullY-axis label text
TrendlineTrendlineConfig?nullTrendline config
TrendlineOpacitydouble0.6Opacity of the trendline (0.0 to 1.0)

Plus all shared ChartBase parameters.

Events

EventTypeDescription
OnPointClickEventCallback<PointClickEventArgs<T>>Fired when a data point is clicked. Receives item, index, and series context