Export and download

Save a chart as PNG or SVG, or its data as CSV, straight from the browser. Images show the chart as it is drawn: the current size, zoom, hidden series and the page's theme colors. No server-side rendering or extra package is needed.

Download menu

Exportable adds a download button in the top-right corner. It shows while the pointer is over the chart (always on touch screens) and opens a menu with PNG, SVG and CSV. Files are named after the title unless you set ExportFileName.

Chart "Sessions, web and app" with 2 series. Web: 192 values, lowest 28 at 11/17/2026 7:45 AM, highest 252 at 11/16/2026 8:00 PM, trend stable. App: 192 values, lowest 13 at 11/16/2026 7:45 AM, highest 165 at 11/17/2026 7:45 PM, trend rising. Sessions, web and app0100200300Nov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PMSessionsWebAppUse Left and Right to move between points, Up and Down to change series. Press Escape to leave.
Code
Razor
<RioChart TItem="Reading" Title="Sessions, web and app" Exportable="true">
    <LineSeries Items="web" Name="Web" XValue="r => r.Time" YValue="r => r.Value" Format="#,0" />
    <LineSeries Items="app" Name="App" XValue="r => r.Time" YValue="r => r.Value" Format="#,0" />
</RioChart>

Export from code

The same exports are methods on the chart reference. Download…Async saves a file in the browser. ExportPngAsync and ExportSvgAsync return the image to .NET (for uploads, emails or reports), and ExportCsv returns the data of every series as text: an x column and one column per series, numbers in invariant culture, times in ISO 8601.

Chart with 1 series. Orders: 35 values, lowest 159 at 11/2/2026 12:00 AM, highest 290 at 10/18/2026 12:00 AM, trend falling. 0100200300Oct 19Oct 26Nov 2Nov 9Nov 16OrdersUse Left and Right to move between points. Press Escape to leave.

Code
Razor
<RioChart @ref="chart" TItem="Reading">
    <BarSeries Items="dailyOrders" Name="Orders" XValue="r => r.Time" YValue="r => r.Value" Format="#,0" />
</RioChart>

<button @onclick="() => chart.DownloadPngAsync(options: new ChartImageOptions { Scale = 3 })">Download PNG (3×)</button>
<button @onclick="() => chart.DownloadSvgAsync()">Download SVG</button>
<button @onclick="() => chart.DownloadCsvAsync(options: new CsvOptions { Delimiter = ';' })">Download CSV (;)</button>

@code {
    RioChart<Reading> chart = null!;

    async Task Upload()
    {
        byte[] png = await chart.ExportPngAsync();
        string svg = await chart.ExportSvgAsync(new ChartImageOptions { Background = "transparent" });
        string csv = chart.ExportCsv();
    }
}

Choose formats and handle the export

ExportFormats picks the menu items; with a single format the button saves it directly. OnExporting runs when the user picks one, before the file is saved: change FileName, ImageOptions or CsvOptions, or set Cancel and do something else with the content, such as uploading it. GetPngAsync, GetSvgAsync and GetCsv make the content only when called, so a handler that just renames the file sends nothing to .NET.

Here PNG is saved with the date in its name at 3×, and CSV is shown below instead of downloaded.

Chart with 1 series. Conversion: 177 values, lowest 1.73 % at 11/17/2026 7:30 AM, highest 3.56 % at 11/16/2026 8:45 PM, trend rising. 1234Nov 166:00 AM12:00 PM6:00 PMNov 176:00 AM12:00 PM6:00 PM%Use Left and Right to move between points. Press Escape to leave.
Code
Razor
<RioChart TItem="Reading" Exportable="true" ExportFormats="ExportFormats.Png | ExportFormats.Csv" OnExporting="HandleExport">
    <LineSeries Items="conversion" Name="Conversion" XValue="r => r.Time" YValue="r => r.Value" Format="0.00 '%'" />
</RioChart>

@code {
    async Task HandleExport(ChartExportingEventArgs e)
    {
        e.FileName = $"conversion-{DateTime.Today:yyyy-MM-dd}.{e.Format.ToString().ToLowerInvariant()}";
        if (e.Format == ExportFormat.Png)
        {
            e.ImageOptions = new ChartImageOptions { Scale = 3 };
        }
        else if (e.Format == ExportFormat.Csv)
        {
            e.Cancel = true; // no download
            await storage.UploadAsync(e.FileName, e.GetCsv());
        }
    }
}

Options

OptionDefaultMeaning
ChartImageOptions.Scale2PNG pixels per CSS pixel.
ChartImageOptions.Backgroundthe surface colorAny CSS color; "transparent" for none.
ExportFormatsAllFormats in the menu (Png, Svg, Csv); one format saves directly.
OnExportingRaised on a menu pick before the file is saved; not raised for calls from code.
CsvOptions.Delimiter,Column separator, e.g. ; for spreadsheets with a decimal comma.
CsvOptions.CultureinvariantCulture for numbers.
CsvOptions.XHeaderthe x axis title, else xHeader of the x column.
Images use the fonts installed on the viewer's machine: a web font the page loads is not available inside the image, so text falls back to the next font in the list. For images made without a browser (emails, scheduled reports), use server-side export.
An unhandled error has occurred. Reload 🗙