Plotly.NET.ImageExport
7.0.0
dotnet add package Plotly.NET.ImageExport --version 7.0.0
NuGet\Install-Package Plotly.NET.ImageExport -Version 7.0.0
<PackageReference Include="Plotly.NET.ImageExport" Version="7.0.0" />
<PackageVersion Include="Plotly.NET.ImageExport" Version="7.0.0" />
<PackageReference Include="Plotly.NET.ImageExport" />
paket add Plotly.NET.ImageExport --version 7.0.0
#r "nuget: Plotly.NET.ImageExport, 7.0.0"
#:package Plotly.NET.ImageExport@7.0.0
#addin nuget:?package=Plotly.NET.ImageExport&version=7.0.0
#tool nuget:?package=Plotly.NET.ImageExport&version=7.0.0
Plotly.NET.ImageExport
Render Plotly.NET charts as PNG, JPEG, or SVG images using a headless browser powered by PuppeteerSharp.
Install
dotnet add package Plotly.NET.ImageExport --version 7.0.0
Version 7 targets .NET Standard 2.0 and depends on Plotly.NET 6.x, which NuGet installs automatically. Use a compatible .NET application runtime and an operating system that can run the browser described below.
Export a chart
This F# script writes chart.png in the current directory:
#r "nuget: Plotly.NET.ImageExport, 7.0.0"
open Plotly.NET
open Plotly.NET.ImageExport
let chart =
Chart.Line([ (1., 2.); (2., 4.); (3., 3.) ])
|> Chart.withDisplayOptions(
DisplayOptions.init(PlotlyJSReference = PlotlyJSReference.Full)
)
chart |> Chart.savePNG("chart", Width = 800, Height = 450)
Pass a path without an extension; the save functions append .png, .jpg, or .svg. The output directory must already exist and be writable. The example embeds plotly.js so the browser does not need to fetch it from a CDN.
Output formats
| Format | Save to a file | Return an image string |
|---|---|---|
| PNG | Chart.savePNG |
Chart.toBase64PNGString — PNG data URI |
| JPEG | Chart.saveJPG |
Chart.toBase64JPGString — JPEG data URI |
| SVG | Chart.saveSVG |
Chart.toSVGString — SVG markup |
These functions accept Width, Height, and Scale options, defaulting to 600, 600, and 1.0. Corresponding Async functions, such as Chart.savePNGAsync, return tasks that you can await.
Browser requirements
The default renderer uses PuppeteerSharp 24.40.0 to download a compatible Chrome browser when needed and launch it for each export. Browser setup requires network access and a writable browser download/cache location. The host must permit browser processes and provide the required operating-system libraries; see the PuppeteerSharp prerequisites.
To use a preinstalled compatible Chrome/Chromium executable and skip the automatic download, set PuppeteerSharpRendererOptions.localBrowserExecutablePath to Some "/absolute/path/to/chrome" before exporting. Launch and navigation settings are available through PuppeteerSharpRendererOptions.launchOptions and PuppeteerSharpRendererOptions.navigationOptions.
Charts that reference external images, fonts, map resources, or a plotly.js CDN may still need network access during rendering.
See the image export guide for more examples and the release notes for version changes.
Licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- FSharp.Core (>= 10.1.403)
- Plotly.NET (>= 6.0.0 && < 7.0.0)
- PuppeteerSharp (>= 24.40.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Plotly.NET.ImageExport:
| Package | Downloads |
|---|---|
|
Benchly
Package Description |
|
|
Softellect.Analytics
Softellect Analytics... |
|
|
QualIQon
QualIQon - Visual quality control for computational proteomics |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Plotly.NET.ImageExport:
| Repository | Stars |
|---|---|
|
bitfaster/BitFaster.Caching
High performance, thread-safe in-memory caching primitives for .NET
|
| Version | Downloads | Last Updated |
|---|---|---|
| 7.0.0 | 35 | 10/29/2026 |
| 7.0.0-preview.1 | 345 | 7/29/2025 |
| 6.1.0 | 396,325 | 9/4/2024 |
| 6.0.0 | 6,634 | 5/27/2024 |
| 5.0.1 | 77,147 | 7/25/2023 |
| 5.0.0 | 1,510 | 7/14/2023 |
| 4.0.0 | 67,427 | 3/21/2023 |
| 3.0.0 | 13,126 | 6/15/2022 |
| 2.0.0 | 1,742 | 4/28/2022 |
| 2.0.0-preview.18 | 711 | 3/4/2022 |
| 2.0.0-preview.17 | 20,830 | 2/8/2022 |
| 2.0.0-preview.16 | 17,607 | 11/27/2021 |
| 2.0.0-preview.15 | 408 | 11/16/2021 |
| 2.0.0-preview.14 | 338 | 11/12/2021 |
| 2.0.0-preview.13 | 353 | 11/12/2021 |
| 2.0.0-preview.12 | 401 | 11/8/2021 |
| 2.0.0-preview.11 | 407 | 11/4/2021 |
| 2.0.0-preview.10 | 454 | 10/11/2021 |
| 2.0.0-preview.9 | 451 | 9/30/2021 |
- bump version range of Plotly.NET to [6.0.0, 7.0.0)
- **Breaking:** Plotly.NET.ImageExport assemblies are no longer strong-named. See the Plotly.NET 6.0.0 release notes for context and migration options.
- Update PuppeteerSharp dependency to 24.40.0
- Dev tooling: target framework for test projects updated to `net10.0`