Create interactive plotly.js charts in .NET. Plotly.NET provides an F# API for building, styling, combining, and rendering charts, with lower-level access to traces, layouts, and configuration. This is the core library used by the other Plotly.NET packages.
dotnet add package Plotly.NET --version 6.0.0
The library targets .NET Standard 2.0. For an idiomatic C# API, install Plotly.NET.CSharp as well.
In an F# project with the package installed:
open Plotly.NET let chart = Chart.Line( x = [ 1; 2; 3; 4 ], y = [ 2; 5; 3; 8 ] ) |> Chart.withTitle "My first chart" chart |> Chart.saveHtml "chart.html"
Open chart.html in a browser to interact with the chart. Use chart |> Chart.show
to save a temporary HTML file and open it in your default browser automatically.
For an .fsx script, add #r "nuget: Plotly.NET, 6.0.0" before the example.
By default, the HTML loads plotly.js from a CDN and needs an internet connection. See display options for using an embedded or local plotly.js reference.
- Plotly.NET.CSharp: C# chart factories and extension methods.
- Plotly.NET.Interactive: inline chart display in .NET Interactive / Polyglot Notebooks.
- Plotly.NET.ImageExport: programmatic static image export.
- Examples and tutorials
- API reference
- Release notes and migration information
- Source code and issue tracker
Plotly.NET is licensed under the MIT license.