BlazorExpress.ChartJS 2.0.0

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

BlazorExpress.ChartJS component library

An open-source, production-ready Blazor charts component library built on the Blazor and Chart.js JavaScript library.

Table of contents

Quick start

Get started any way you want

  • Clone the repo: git clone https://github.com/BlazorExpress/BlazorExpress.ChartJS
  • Install with the .NET CLI: dotnet add package BlazorExpress.ChartJS --version 2.0.0
  • Or with the NuGet Package Manager Console: Install-Package BlazorExpress.ChartJS -Version 2.0.0
  • Upgrading from 1.x? 2.0.0 changes some defaults and behaviour, so read the 2.0.0 release notes first.

Then draw your first chart:

  1. Add the scripts to wwwroot/index.html (Blazor WebAssembly) or Components/App.razor (Blazor Web App), after Blazor's own script (_framework/blazor.webassembly.js or _framework/blazor.web.js):

    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.6.1/chart.umd.js" integrity="sha512-Vj/VnWZpOof68AJOIBxA90+7KQccA7eISngKbl18q5MQO3KnvO1a0z76Q+7hj8+iDIwETpKUBPN+cLy7PxvTEQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js" integrity="sha512-JPcRR8yFa8mmCsfrw4TNte1ZvF1e3+1SdGMslZvmrzDYxS69J7J49vkFL8u6u8PlPJK+H3voElBtUCzaXj+6ig==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    
    <script src="_content/BlazorExpress.ChartJS/blazorexpress.chartjs.js"></script>
    
  2. Add the namespace to _Imports.razor:

    @using BlazorExpress.ChartJS
    
  3. Add a chart to a page. In a Blazor Web App, the page needs an interactive render mode, for example @rendermode InteractiveServer at the top of the page; without one the page renders as static HTML and the chart is not drawn.

<BarChart @ref="barChart" role="img" aria-label="Bar chart: units sold per month" Width="600" />

@code {
    private BarChart barChart = default!;

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (!firstRender)
            return;

        var data = new ChartData
        {
            Labels = new List<string> { "January", "February", "March", "April" },
            Datasets = new List<IChartDataset>
            {
                new BarChartDataset
                {
                    Label = "Units sold",
                    Data = new List<double?> { 120, 150, 180, 140 },
                    BackgroundColor = new List<string> { "rgb(81, 43, 212)" },
                },
            },
        };

        await barChart.InitializeAsync(data, new BarChartOptions { Responsive = true });
    }
}

The getting started guide covers installation for Blazor WebAssembly and Blazor Web App (Server), and the samples show every chart type and option.

Online Demos

  • Demos Website
  • Samples gallery: every sample with copyable source, searchable by chart, category and tag
  • Scenarios: real-world tasks such as loading data from an API, live updates, dashboards, dark theme colours and large datasets

Supported Tech Stack

BlazorExpress.ChartJS .NET Chart.js chartjs-plugin-datalabels
2.0.0+ 8, 9, 10, 11 4.6.1 2.2.0
1.2.2+ 8, 9, 10 4.4.1 2.2.0
1.1.0+ 8 4.4.1 2.2.0
1.0.0 8 4.0.1 2.2.0

Components

Component Name Demos Docs
Charts: Bar chart Demos Docs
Charts: Bubble chart Demos Docs
Charts: Doughnut chart Demos Docs
Charts: Line chart Demos Docs
Charts: Pie chart Demos Docs
Charts: Polar area chart Demos Docs
Charts: Radar chart Demos Docs
Charts: Scatter chart Demos Docs

Screenshots

Captured from the online demos; each image links to the sample it shows.

Chart types

Bar chart

Bar chart: website visitors by browser, stacked by operating system, with data labels

Open the sample

Bubble chart

Bubble chart: cities by household income, population growth and population

Open the sample

Doughnut chart

Doughnut chart: revenue by sales channel, one ring per year, with data labels

Open the sample

Line chart

Line chart: website visitors and sign-ups per month on two axes

Open the sample

Pie chart

Pie chart: revenue by sales channel, one ring per year, with data labels

Open the sample

Polar area chart

Polar area chart: sales by region, each region named in its slice

Open the sample

Radar chart

Radar chart: two laptops rated on six measures

Open the sample

Scatter chart

Scatter chart: ad spend against revenue for twelve campaigns

Open the sample

New in 2.0.0

Time series

Line chart on a timeseries axis with dates from C#; no date adapter script needed.

Line chart: values over dates on a time series axis

Open the sample

Tick and tooltip functions

Axis ticks and tooltip text formatted by JavaScript functions registered by name and set from C#.

Line chart: axis ticks and tooltips formatted by JavaScript functions

Open the sample

Floating bars

A project schedule drawn with floating bars, each with a start and an end value (BarChartDataset.FloatingData).

Bar chart: floating bars from a start to an end value

Open the sample

Half gauge

A half-doughnut gauge from Rotation and Circumference.

Doughnut chart: a half gauge

Open the sample

Gradient fill

A line area filled with a gradient set by a JavaScript function.

Line chart: an area filled with a gradient

Open the sample

Multiple axes

A second y axis on the right (Scales.AdditionalAxes).

Line chart: two datasets on separate y-axes

Open the sample

More components coming...

Creators

Vikram Reddy

Code and documentation copyright 2026 Blazor Express Code released under the Apache-2.0 License.

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 is compatible.  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 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.  net11.0 is compatible. 
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 (1)

Showing the top 1 popular GitHub repositories that depend on BlazorExpress.ChartJS:

Repository Stars
vikramlearning/blazorbootstrap
An Enterprise-class Blazor Bootstrap Component library built on the Blazor and Bootstrap CSS frameworks.
Version Downloads Last Updated
2.0.0 378 11/21/2026
1.2.4 13,688 7/14/2026
1.2.3 4,677 5/22/2026
1.2.2 1,825 4/18/2026
1.2.1 3,177 2/25/2026
1.2.0 7,053 8/13/2025
1.1.0 305 8/9/2025
1.0.0 345 6/16/2024
1.0.0-preview1 245 6/13/2024