DaisyBlazor.Charts 0.2.0

dotnet add package DaisyBlazor.Charts --version 0.2.0
                    
NuGet\Install-Package DaisyBlazor.Charts -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DaisyBlazor.Charts" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DaisyBlazor.Charts" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="DaisyBlazor.Charts" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DaisyBlazor.Charts --version 0.2.0
                    
#r "nuget: DaisyBlazor.Charts, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DaisyBlazor.Charts@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DaisyBlazor.Charts&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=DaisyBlazor.Charts&version=0.2.0
                    
Install as a Cake Tool

DaisyBlazor.Charts

Theme-aware, dependency-free SVG charts for Blazor.

There is zero charting runtime dependency — no ApexCharts, no Chart.js, no JS interop. Every chart is rendered as pure inline <svg> whose geometry is computed in C#. Colors are emitted as daisyUI v5 CSS custom properties (var(--color-primary), var(--color-secondary), var(--color-accent), …), so charts automatically follow the active data-theme with no recompilation. The only project reference is DaisyBlazor.Components (for the public Color enum and the CssClass class-merge helper).

Components

Component Renders Key parameters
LineChart One or more line series over a gridded axis Series, Labels, Area, Smooth, ShowGrid, ShowPoints, ShowLegend
AreaChart Filled line area (LineChart with Area=true, for discoverability) Series, Labels, Smooth, ShowGrid, ShowPoints, ShowLegend
BarChart Vertical or horizontal bars (flat or grouped) Data, Series, Labels, Horizontal, ShowGrid, ShowLegend
PieChart Pie slices with legend + percentages Data, ShowLegend, InnerRadiusRatio, CenterLabel
DonutChart Donut (pie with a hole) + optional center label Data, ShowLegend, InnerRadiusRatio, CenterLabel
Sparkline Tiny axis-less inline trend line Data, Area, ShowEndDot, StrokeWidth, Color

All chart components also accept Width (default "100%"), Height (default "16rem"; Sparkline "1.5rem"), Title, and the standard Class / Style / unmatched-attribute splat.

Models

// A single categorical point (bar / pie / donut). Color is an optional per-point override.
public record ChartDataPoint(string Label, double Value, string? Color = null);

// A named numeric series (line / area / grouped bar).
public class ChartSeries
{
    public string Name { get; set; }
    public IReadOnlyList<double> Data { get; set; }
    public string? Color { get; set; }
}

ChartPalette resolves colors as theme tokens and cycles primary → secondary → accent → info → success → warning → error. Per-point/series Color overrides take precedence; pass any CSS color ("var(--color-info)", "#0af", "oklch(...)").

Usage

@using DaisyBlazor.Charts

<LineChart Title="Traffic"
           Labels="@(new[] { "Mon", "Tue", "Wed", "Thu", "Fri" })"
           Series="@_series"
           Smooth Area />

<BarChart Data="@(new[]
          {
              new ChartDataPoint("A", 12),
              new ChartDataPoint("B", 28),
              new ChartDataPoint("C", 19)
          })" />

<DonutChart Data="@_breakdown" CenterLabel="100%" />

<Sparkline Data="@(new double[] { 3, 5, 4, 8, 6, 9 })" Area />

@code {
    private readonly ChartSeries[] _series =
    {
        new("Visitors", new double[] { 30, 40, 35, 50, 49 }),
        new("Signups",  new double[] {  5,  8,  6, 12, 10 })
    };

    private readonly ChartDataPoint[] _breakdown =
    {
        new("Direct", 40),
        new("Search", 35),
        new("Social", 25)
    };
}

Notes & geometry

  • Charts use a fixed user-space viewBox scaled responsively (preserveAspectRatio), so they stay crisp at any size.
  • Value axes include a zero baseline; flat or empty data is handled without divide-by-zero.
  • Pie/donut arcs are built from cumulative angles (0 = 12 o'clock, clockwise) using SVG A arc commands; a single full-circle slice is nudged to avoid a degenerate zero-length arc.
  • Smooth line mode uses Catmull-Rom-to-Bézier conversion.
  • Every chart sets role="img" and an accessible <title> (from Title when provided).
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 0 6/7/2026
0.1.6 100 6/5/2026
0.1.5 57 6/4/2026
0.1.4 42 6/4/2026
0.1.3 45 6/4/2026
0.1.2 46 6/4/2026
0.1.1 39 6/4/2026
0.1.0 40 6/4/2026