Skip to content

Latest commit

 

History

History

Plotly.NET

README.md

Plotly.NET

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.

Installation

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.

Quick start

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.

Related packages

Documentation and support

Plotly.NET is licensed under the MIT license.