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:
TItemtype 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
Bar Chart
Vertical bar charts for comparing values across categories
Line Chart
Smooth line charts for showing trends over time
Area Chart
Filled area charts for showing volume and trends
Pie Chart
Pie charts with custom tooltips for proportions
Multi-Series Chart
Multiple data series with mixed chart types
Donut Chart · New
Donut charts for part-to-whole data
Radar Chart · New
Radar charts for comparing values across categories
Radial Chart · New
Radial bar charts for progress and percentages
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>