Meziantou.Framework.Charts 1.0.2

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

Meziantou.Framework.Charts

Creates charts and writes them as SVG, with a grammar of graphics: a plot is made of marks (bars, lines, dots, arcs, rectangles...), whose channels are mapped by scales and placed by Cartesian or polar coordinates. Bar, line, area, scatter, bubble, pie, donut, radar, gauge, packed circles, treemap, sunburst, icicle, histogram, box plot, heatmap, waterfall, funnel and candlestick charts are combinations of these pieces. The output is deterministic.

Usage

The types are in the Meziantou.Framework.Charts namespace.

public sealed record Sale(string Region, int Year, double Amount);
Sale[] sales =
[
    new("North", 2024, 150),
    new("South", 2024, 95),
    new("East", 2024, 105),
    new("West", 2024, 160),
];

var plot = new Plot { Title = "Sales by region", Subtitle = "2024, in thousands of euros" };
plot.Add(new BarMark<Sale>(sales, x: sale => sale.Region, y: sale => sale.Amount));
var svg = plot.ToSvg();

The scales, axes, margins and legend are inferred from the marks. Stack bars with a transform:

var plot = new Plot { Title = "Sales by region, stacked by year" };
plot.Add(new BarMark<Sale>(SampleData.Sales, x: sale => sale.Region, y: sale => sale.Amount)
{
    Fill = sale => sale.Year,
    Transform = new StackTransform(),
});

A pie is an arc mark, in the polar coordinates the plot uses by default for it:

Share[] shares = [new("Chrome", 64), new("Safari", 19), new("Edge", 5), new("Firefox", 3), new("Other", 9)];
var plot = new Plot { Title = "Browser market share", Width = 400, Height = 400 };
plot.Add(new ArcMark<Share>(shares, value: share => share.Value)
{
    Fill = share => share.Name,
    Label = share => share.Value.ToString(CultureInfo.InvariantCulture) + "%",
});

Text measurement

The layout measures the texts with the metrics of Helvetica (AfmTextMeasurer), embedded in Meziantou.Framework.Fonts: no font file is needed, and the result is the same on every machine. FontFaceTextMeasurer measures with a font file instead, for other scripts or fonts.

Images

Meziantou.Framework.Imaging.VectorGraphics draws the same charts as PNG, WebP or JPEG images, or on an image canvas. Both renderers draw the Scene that Plot.CreateScene lays out.

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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Meziantou.Framework.Charts:

Package Downloads
Meziantou.Framework.Imaging.Charts

Renders the charts of Meziantou.Framework.Charts with Meziantou.Framework.Imaging: images in any format (PNG, WebP, JPEG...), or vector drawing on a canvas, with embedded Liberation Sans fonts.

Meziantou.Framework.Mermaid

Reads and writes the Mermaid text format: the 25 diagram types of Meziantou.Framework.Diagrams, and the pie, XY, quadrant, sankey and radar charts and treemaps of Mermaid drawn with Meziantou.Framework.Charts, with the front matter, the directives and the themes of Mermaid.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 39 11/13/2026
1.0.1 134 11/8/2026
1.0.0 120 11/6/2026