Charts

Data visualization components built on ApexCharts.Blazor with theme-aware styling

ShellUI includes 8 chart types built on ApexCharts.Blazor, offering beautiful, responsive, and theme-aware data visualizations for your Blazor applications.

Overview

Chart components are built with:

  • ApexCharts.Blazor: Professional charting library with rich interactivity
  • Generic Type System: TItem type parameter for strongly-typed data binding
  • Theme-Aware Containers: Charts use your CSS variables (--border, --card, --radius, --shadow)
  • Three Built-in Themes: Default, Colorful, and Monochrome color palettes

Chart Types

Installation

Install all chart components at once:

bash
shellui add chart bar-chart line-chart pie-chart area-chart multi-series-chart

Or install just the chart types you need — chart and chart-variants auto-install as dependencies:

bash
# Just a bar chart
shellui add chart bar-chart

# Bar and line charts
shellui add chart bar-chart line-chart

# All chart types
shellui add chart bar-chart line-chart pie-chart area-chart multi-series-chart

Quick Start

razor
<BarChart TItem="SalesData"
    Data="@salesData"
    Title="Revenue by Quarter"
    XValue="@(e => e.Quarter)"
    YValue="@(e => (decimal?)e.Revenue)"
    Theme="ChartTheme.Default"
    Height="350px" />

@code {
    private List<SalesData> salesData = new()
    {
        new("Q1", 45000), new("Q2", 52000),
        new("Q3", 48000), new("Q4", 61000)
    };

    record SalesData(string Quarter, decimal Revenue);
}

Themes

All chart components support three themes via the ChartTheme enum:

Theme Description
ChartTheme.Default Subtle blue/slate palette, works in light and dark mode
ChartTheme.Colorful Vibrant multi-color palette for distinguishing data series
ChartTheme.Monochrome Minimal slate gray variations for a clean, professional look

NuGet Dependency

All chart components use Blazor-ApexCharts. shellui add adds the package for you; to add it yourself:

bash
dotnet add package Blazor-ApexCharts

Register the service and script in your app:

csharp
// Program.cs
builder.Services.AddApexCharts();
html
<!-- App.razor -->
<script src="_content/Blazor-ApexCharts/js/apex-charts.min.js"></script>

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.