ShellUI Logo
ShellUI

Area Chart

Filled area charts for showing volume and trends

The AreaChart component renders filled area charts, ideal for emphasizing volume, magnitude, and cumulative trends. Built on ApexCharts.Blazor with gradient fills and smooth curves.

Installation

shellui add chart area-chart
dotnet add package Blazor-ApexCharts

chart and chart-variants are auto-installed as dependencies.

Basic Usage

<AreaChart TItem="MemoryUsage"
    Data="@memoryData"
    Title="Memory Usage Over Time"
    Name="Usage (MB)"
    XValue="@(e => e.Time)"
    YValue="@(e => (decimal?)e.UsageMB)"
    Theme="ChartTheme.Default"
    Height="350px" />

@code {
    private List<MemoryUsage> memoryData = new()
    {
        new("10:00", 512), new("10:05", 640),
        new("10:10", 580), new("10:15", 720),
        new("10:20", 690), new("10:25", 810)
    };

    record MemoryUsage(string Time, int UsageMB);
}

Network Traffic

<AreaChart TItem="NetworkData"
    Data="@networkData"
    Title="Network Bandwidth"
    Subtitle="Inbound traffic (Mbps)"
    Name="Bandwidth"
    XValue="@(e => e.Time)"
    YValue="@(e => (decimal?)e.Mbps)"
    Theme="ChartTheme.Colorful"
    Height="400px" />

@code {
    private List<NetworkData> networkData = new()
    {
        new("00:00", 45), new("04:00", 22), new("08:00", 120),
        new("12:00", 250), new("16:00", 310), new("20:00", 180), new("23:59", 65)
    };

    record NetworkData(string Time, int Mbps);
}

Cumulative Revenue

<AreaChart TItem="RevenueData"
    Data="@revenueData"
    Title="Cumulative Revenue"
    Subtitle="FY 2024"
    Name="Revenue (USD)"
    XValue="@(e => e.Quarter)"
    YValue="@(e => (decimal?)e.Cumulative)"
    Theme="ChartTheme.Default"
    Height="350px" />

@code {
    private List<RevenueData> revenueData = new()
    {
        new("Q1", 150000), new("Q2", 340000),
        new("Q3", 520000), new("Q4", 780000)
    };

    record RevenueData(string Quarter, decimal Cumulative);
}

Multiple Areas

For multiple filled areas, use Multi-Series Chart with SeriesType.Area.

API Reference

PropertyTypeDefaultDescription
TItemGeneric typeThe data item type
DataIEnumerable<TItem>?nullData collection to visualize
Namestring"Data"Series name shown in legend/tooltip
XValueFunc<TItem, object>?nullFunction to extract X-axis value
YValueFunc<TItem, decimal?>?nullFunction to extract Y-axis value
ThemeChartThemeDefaultColor theme (Default, Colorful, Monochrome)
Titlestring?nullChart title
Subtitlestring?nullChart subtitle
Heightstring?"400px"Chart height
Widthstring?"100%"Chart width
Classstring?nullAdditional CSS classes

On this page