Server-side export

Render charts to PNG or SVG on the server in .NET. RioCharts.Skia draws the same chart model and layout as the Blazor components, with real font metrics. Use it for emails, reports, Teams or Slack messages, and AI agents.

Terminal
dotnet add package RioCharts.Skia --prerelease

On Linux it uses SkiaSharp's native assets without system dependencies; install a font package in slim containers (see FontFamily below).

C#
var spec = new ChartDefinition
{
    Title = "Orders per day",
    Y = new AxisOptions { Title = "Orders" },
    Series = [new SeriesOptions { Id = "orders", Name = "Orders", Curve = CurveType.Monotone }],
    Annotations = [new Annotation { Value = 250, Label = "Target" }],
};
var data = new Dictionary<string, SeriesData> { ["orders"] = SeriesData.From(days, orders) };

byte[] png = ChartExport.ToPng(spec, data, new ExportOptions { Width = 640, Height = 320, Theme = ExportTheme.Dark });
string svg = ChartExport.ToSvg(spec, data);

// In a minimal API:
app.MapGet("/charts/orders.png", () => Results.File(ChartExport.ToPng(spec, data), "image/png"));

Options

OptionDefaultMeaning
Width, Height800 × 400Chart size in pixels.
Scale2Pixel density of the PNG (2 = sharp on high-density screens).
ThemeExportTheme.LightOr Dark; .With("--rio-series-1", "#0b6e4f") overrides a token.
Backgroundthe surface colorNull for a transparent PNG.
FontFamilySegoe UI, Inter, Roboto, ...The first installed font is used. In Linux containers install fonts (e.g. fonts-dejavu).
CssVariablesfalseSVG only: write colors as var(--rio-…, color) so a page can restyle it.
Charts made with components export in the browser with chart.ExportPngAsync() and chart.ExportSvgAsync(); or serialize chart.GetDefinition() and render it here later.
An unhandled error has occurred. Reload 🗙