ChartsKit.Blazor 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package ChartsKit.Blazor --version 1.0.3
                    
NuGet\Install-Package ChartsKit.Blazor -Version 1.0.3
                    
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="ChartsKit.Blazor" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ChartsKit.Blazor" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="ChartsKit.Blazor" />
                    
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 ChartsKit.Blazor --version 1.0.3
                    
#r "nuget: ChartsKit.Blazor, 1.0.3"
                    
#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 ChartsKit.Blazor@1.0.3
                    
#: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=ChartsKit.Blazor&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=ChartsKit.Blazor&version=1.0.3
                    
Install as a Cake Tool

Version: 1.0.3 Author: Shimon Hirari

ChartsKit is a reusable .NET 9 charting library designed to simplify the creation of beautiful, data-driven charts in Blazor applications. It provides a set of strongly-typed C# "Builders" that abstract away the complexity of ECharts JSON configuration, allowing developers to generate a wide variety of charts quickly and safely using familiar C# models.

This library is designed to be extensible, themeable, and easy to integrate into any Blazor Server project.

Features

  • 20+ Chart Types: Includes Bar, Line, Pie, Doughnut, Scatter, Gauge, Funnel, Radar, BoxPlot, Treemap, Candlestick, Heatmap, Sankey, Tree, Sunburst, Parallel, Calendar Heatmap, Gantt, Area, and Map charts.
  • Fluent Builder API: A simple, intuitive C# API for configuring charts without writing complex JSON.
  • Theming Support: Easily switch between "light" and "dark" modes, or create your own custom themes.
  • Image Export: Export any chart to PNG or SVG with a single method call.
  • Strongly-Typed Models: Reduce errors with C# data models for all chart types.

How to Use

1. Install NuGet Package

Install the ChartsKit.Blazor package from NuGet:

dotnet add package ChartsKit.Blazor
2. Include JavaScript Files
In your application's root component (e.g., App.razor), you must include the required JavaScript files in the following order, typically at the end of the <body> tag:

HTML

<script src="_content/ChartsKit.Blazor/js/echarts.min.js"></script>
<script src="_content/ChartsKit.Blazor/js/world.js"></script> 
<script src="_content/ChartsKit.Blazor/js/interop.js"></script>
3. Use the ChartView Component
In any Razor component, use the <ChartView> component to display a chart.

Example: Bar Chart

HTML

@using ChartsKit.Blazor
@using ChartsKit.Core.Builders
@using ChartsKit.Core.Models

<h3>My Bar Chart</h3>

<div style="height: 400px; width: 100%;">
    <ChartView Options="@_chartOptions" />
</div>

@code {
    private object? _chartOptions;

    protected override void OnInitialized()
    {
        var barChartBuilder = new BarChartBuilder();
        var myData = new CategoryData[]
        {
            new("Apples", 50),
            new("Oranges", 75),
            new("Bananas", 120)
        };
        _chartOptions = barChartBuilder.Build(myData, seriesName: "Fruit Sales");
    }
}
4. Using Themes and Exporting
You can easily apply a theme and export a chart.

HTML

@using ChartsKit.Blazor
@inject IJSRuntime JSRuntime

<div style="height: 500px; width: 100%;">
    <ChartView @ref="_chartView" Options="@_chartOptions" Theme="dark" />
</div>
<button @onclick="ExportChart">Export as PNG</button>

@code {
    private ChartView? _chartView;
    private object? _chartOptions;

    // (Chart generation logic...)

    private async Task ExportChart()
    {
        if (_chartView != null)
        {
            var dataUrl = await _chartView.ExportAsync("png");
            if (!string.IsNullOrEmpty(dataUrl))
            {
                // This JS interop call triggers a file download in the browser
                await JSRuntime.InvokeVoidAsync("eval", $"let a = document.createElement('a'); a.href = '{dataUrl}'; a.download = 'chart.png'; a.click();");
            }
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET 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 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
1.0.8 291 7/2/2025
1.0.7 240 7/1/2025
1.0.6 229 7/1/2025
1.0.5 233 7/1/2025
1.0.4 250 7/1/2025
1.0.3 241 6/30/2025
1.0.2 227 6/30/2025
1.0.1 223 6/30/2025
1.0.0 223 6/30/2025