LightweightCharts.Blazor
3.8.0
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
<PackageReference Include="LightweightCharts.Blazor" Version="3.8.0" />
paket add LightweightCharts.Blazor --version 3.8.0
#r "nuget: LightweightCharts.Blazor, 3.8.0"
// 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 | Versions 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. |
-
net6.0
- Microsoft.AspNetCore.Components.Web (>= 6.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
First release