LightweightCharts.Blazor 3.8.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package LightweightCharts.Blazor --version 3.8.0                
NuGet\Install-Package LightweightCharts.Blazor -Version 3.8.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LightweightCharts.Blazor" Version="3.8.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LightweightCharts.Blazor --version 3.8.0                
#r "nuget: LightweightCharts.Blazor, 3.8.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install LightweightCharts.Blazor as a Cake Addin
#addin nuget:?package=LightweightCharts.Blazor&version=3.8.0

// Install LightweightCharts.Blazor as a Cake Tool
#tool nuget:?package=LightweightCharts.Blazor&version=3.8.0                

<div align="center"> <h1>LightweightCharts for Blazor</h1> A blazor wrapper for TradingView's Lightweight Charts javascript library. </div>

Installing

Install the package via the NuGet package manager.<br/> Add the script imports to your root html file (index.html or _Layout.cshtml).

<script src="_content/LightweightCharts.Blazor/lightweight-charts.scripts.js"></script>
<script src="_content/LightweightCharts.Blazor/lightweight-charts.standalone.js"></script>

How to use it

Add the chart component to your razor file.

@using LightweightCharts.Blazor.Charts
<ChartComponent @ref="Chart" />

Wait for the chart component to finish its initialization, then use the exposed api methods to add data series to it.

await Chart.InitializationCompleted;
var series = await Chart.AddLineSeriesAsync();

The Github repository contains a demo project with several examples (all available series, custom options, multiple series in a chart, multiple charts, etc.).

Limitations

Synchronous methods can't be forwarded to c# code. Because of this, some options can be set only from javascript. The demo project contains an example that offers a workaround. Known options not available in c# wrappers are:

  • TimeScale options tickMarkFormatter;
  • Series options autoscaleInfoProvider;

Debugging

Clone the LightweightCharts.Blazor project and add a project reference to it in your blazor client.<br/> The contents of 'lightweight-charts.standalone.js' can be replaced with the development version to debug the javascript library.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.1.2.1 395 1/21/2024
3.8.0 1,234 3/16/2022

First release