Create interactive charts in C# with chart constructors and fluent styling methods built on Plotly.NET. Charts render with plotly.js in a browser or a .NET Interactive notebook.
Version 0.14.0 targets .NET 10. Your application must target .NET 10 or later. Installing this package also installs the core Plotly.NET library, with a supported version range of >= 6.0.0 and < 7.0.0.
In a C# project:
dotnet add package Plotly.NET.CSharp --version 0.14.0Put this code in Program.cs and run the application:
using Plotly.NET.CSharp;
var chart = Chart.Point<double, double, string>(
x: new[] { 0.0, 1.0, 2.0, 3.0 },
y: new[] { 1.0, 4.0, 9.0, 16.0 },
Name: "Squares"
);
chart.Show();Show() opens the chart in your browser. To save an HTML file instead, use chart.SaveHtml("chart.html"). The third generic argument, string, supplies the optional point-text type even when no text is provided.
For inline notebook output, reference Plotly.NET.Interactive as well and end the cell with the chart value. The notebook's C# kernel must support .NET 10.
Licensed under the MIT License.