BlazorGraphs 3.0.0

dotnet add package BlazorGraphs --version 3.0.0
                    
NuGet\Install-Package BlazorGraphs -Version 3.0.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="BlazorGraphs" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlazorGraphs" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BlazorGraphs" />
                    
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 BlazorGraphs --version 3.0.0
                    
#r "nuget: BlazorGraphs, 3.0.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 BlazorGraphs@3.0.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=BlazorGraphs&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BlazorGraphs&version=3.0.0
                    
Install as a Cake Tool

Existing Blazor chart libraries often wrap Javascript libraries, requiring JSInterop and external dependencies. BlazorGraphs was built to provide a fully native Blazor experience using only C# and SVG.

Main features:

  • Native Blazor
  • SSR friendly
  • WASM
  • SVG
  • No JS

The library clearly distinguishes between the data representation model and the graphics rendering. This way, you populate the model entirely in C#, and then pass it directly to the chart component.

Some components share the same data model, such as gauges, or the pie chart and the donut chart. This way, to change visualizations, you simply assign the model to the other compatible component with zero code rewrites.

Charts

  • Histogram
  • Vertical Barchart
  • Horizontal Barchart
  • Line chart
  • Step chart
  • Scatter chart
  • Bubble chart
  • Pie chart
  • Donut chart
  • Radar chart
  • PolarArea chart

Gauges

  • Horizontal gauge
  • Vertical gauge
  • Semicircle gauge
  • Speedometer

Namespaces

  • BlazorGraphs
  • BlazorGraphs.Components

The root namespace contains all datamodels and structures needed to populate the charts, while BlazorGraphs.Components contains all the charting, gauges and legends components.

How to use

Each chart or gauge have a dedicated data model as parameter, the data model contains all the data needed to draw the chart.

Each data model has two methods:

  • Add or AddSerie : to add new data or a new serie if the model supports it
  • Clear: to remove all the existing data from the model
Legends

The legend is separated from the charts, there are two separated components:

  • LegendHorizontal
  • LegendVertical

The legend components accepts the same data models of charts as parameter, since this is separated from the chart, you can place everywhere you want.

Themes

Is possible to customize the chart, gauges and legends simply passing the Theme. It allows you to customize:

  • background color
  • axis color
  • text color
  • font family

If you pass a partially empty theme, the library doesn't break. It delegates the fallback to the browser engine using native properties:

  • background color defaults to Transparent
  • text and axis colors fallback to currentColor
  • font family defaults to Inherit
Histogram example

This renders a fully interactive SVG histogram.

<HistChart Model="@model"></HistChart>

@{
    Histogram model = new Histogram("asseX", "asseY", KnownColor.CadetBlue);

    for (int i = 0; i < 10; i++)
    {
        model.Add(new Bin()
        {
            Min = i, //bin left side
            Max = i + 1, //bin right side
            Value = 10 + i //bin height
        });
    }
}
Barchart example

This renders a fully interactive SVG vertical barchart, with negative bars colored differently from positive ones.

<VerticalBarChart Model="@model"/>

@{
    Bargram model = new Bargram("asseY", KnownColor.RoyalBlue, KnownColor.OrangeRed);

    for (int i = 0; i < 10; i++)
    {
        model.Add(new Bar()
        {
            Label = $"Bar-{i}", //bar label
            Value = 5 - i //bar height
        });
    }
}
Cartesian charts example

This renders a fully interactive SVG linechart, scatterchart and stepchart, all using the same datamodel.

<LineChart Theme="@Theme.Dark" Model="@model"/>
<StepChart Theme="@Theme.Dark" Model="@model"/>
<ScatterChart Theme="@Theme.Light" Model="@model"/>

@{
    Cartesiangram model = new Cartesiangram("X1", "Y1");

    List<Datapoint> points1 = new();
    List<Datapoint> points2 = new();
    List<Datapoint> points3 = new();
    List<Datapoint> points4 = new();

    for (int i=0; i<10; i++)
    {
        points1.Add(new Datapoint(i, i));
        points2.Add(new Datapoint(i, i + 2));
        points3.Add(new Datapoint(i, i + 3));
        points4.Add(new Datapoint(i, i + 4));
    }

    model.AddSerie("F1", KnownColor.LimeGreen, points1);
    model.AddSerie("F2", KnownColor.OrangeRed, points2);
    model.AddSerie("F3", KnownColor.CadetBlue, points3);
    model.AddSerie("F4", KnownColor.DodgerBlue, points4);
}
Gauge example

This renders a fully interactive SVG horizontal gauge, the breakpoints are optional.

<HorizontalGauge Theme="@Theme.Arctic" Model="@model" Reverse="false"/>

@{
    Gaugegram model = new Gaugegram(0, 500, "G1", KnownColor.Navy);
    model.Value = 175;
    model.AddBreakpoint(new Breakpoint()
    {
        Value = 150,
        Color = KnownColor.Green,
        Label = "LV-1"
    });
    model.AddBreakpoint(new Breakpoint()
    {
        Value = 250,
        Color = KnownColor.Gold,
        Label = "LV-2"
    });
    model.AddBreakpoint(new Breakpoint()
    {
        Value = 500,
        Color = KnownColor.Red,
        Label = "LV-3"
    });
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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
3.0.0 93 8/12/2026
2.4.0 129 7/5/2026
2.3.1 114 6/28/2026
2.3.0 126 6/21/2026
2.2.0 118 6/9/2026
2.1.1 127 5/31/2026
2.1.0 120 5/23/2026
2.0.0 135 4/27/2026

- Added Stepline chart
- Added Scatter chart
- Added Bubbles chart
- Improved color choices
- Refactored Line chart
- Reduced namespaces
- Renamed some components
- Removed obsolete components
- Removed enums