Line Chart
Single or multi-series line chart with area fill, trendlines, data points, and null data handling.
Basic Usage
<ArcadiaLineChart TItem="SalesRecord" Data="@data"
XField="@(d => (object)d.Month)"
Series="@series"
Height="300" Width="600" />
@code {
record SalesRecord(string Month, double Revenue);
var data = new List<SalesRecord>
{
new("Jan", 45000), new("Feb", 52000),
new("Mar", 48000), new("Apr", 61000),
};
var series = new List<SeriesConfig<SalesRecord>>
{
new() { Name = "Revenue", Field = d => d.Revenue }
};
}
Multi-Series with Area Fill
var series = new List<SeriesConfig<SalesRecord>>
{
new() { Name = "Revenue", Field = d => d.Revenue,
Color = "primary", ShowArea = true },
new() { Name = "Target", Field = d => d.Target,
Color = "secondary", Dashed = true },
};
With Trendline
new() {
Name = "Revenue", Field = d => d.Revenue,
Trendline = new()
{
Type = TrendlineType.Linear,
Color = "danger",
Dashed = true,
}
}
Line Chart Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
XField | Func<T, object> | required | X-axis label selector |
Series | List<SeriesConfig<T>> | required | Series configurations |
ShowPoints | bool | true | Show data point dots on lines (overridden per-series by SeriesConfig.ShowPoints) |
NullHandling | NullHandling | Gap | How to handle null/missing data values: Gap, Connect, or Zero |
Stacked | bool | false | When true, area fills stack on top of each other instead of starting from zero |
SlidingWindow | int | 0 | Maximum number of points to keep in sliding window mode (0 = no limit) |
XAxisType | string | "category" | X-axis mode: "category" (equal spacing) or "time" (continuous DateTime positioning) |
Plus all shared ChartBase parameters.
Events
| Event | Type | Description |
|---|---|---|
OnPointClick | EventCallback<PointClickEventArgs<T>> | Fired when a data point is clicked. Receives item, data index, and series context |
OnSeriesClick | EventCallback<int> | Fired when a series is clicked. Receives the series index |
Null Data Handling
// Gap — break the line at missing points
<ArcadiaLineChart NullHandling="NullHandling.Gap" />
// Connect — skip missing, connect neighbors
<ArcadiaLineChart NullHandling="NullHandling.Connect" />
// Zero — treat missing as 0
<ArcadiaLineChart NullHandling="NullHandling.Zero" />
Axis Formatting
<ArcadiaLineChart YAxisFormatString="C0"
XAxisFormatString="MMM"
FormatProvider="@CultureInfo.GetCultureInfo("en-US")" />