SciChart.Blazor.Examples
The current version of these examples targets SciChart.Blazor 6, based on SciChart.js 6. To find the examples for version 5, use the v5.x branch.
See the Change Log for the latest updates.

How to run the demo
Setting up a package source
SciChart.Blazor.dll is hosted on our beta Nuget feed for now. You'll need to add a package source to https://www.myget.org/F/abtsoftware-bleeding-edge/api/v3/index.json
Either:
dotnet nuget add source https://www.myget.org/F/abtsoftware-bleeding-edge/api/v3/index.json --name "ABT Bleeding Edge"
- Or, Visual Studio -> Tools -> Nuget Package Manager -> Package Manager Settings -> Package Sources & add package source

Running the demo
Most of examples are in WasmDemo. In order to run:
For running ServerDemo:
Note: if you see an example not updated, please do Empty Cache and Hard Reload in your browser
How to use SciChart.Blazor from scratch
Steps to create a Wasm Demo from scratch
- Create a project
dotnet new blazorwasm -o MyBlazorWasmApp
- Install SciChart.Blazor nuget package
dotnet nuget add source https://www.myget.org/F/abtsoftware-bleeding-edge/api/v3/index.json --name "ABT Bleeding Edge"
dotnet nuget list source
dotnet add package SciChart.Blazor
- Add imports to
_imports.razor file
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using SciChart.Blazor.Components
- Create a Page under pages
Demo.razor
@page "/demo"
@rendermode InteractiveWebAssembly
<PageTitle>Annotations</PageTitle>
<div id="demo" style="display: flex; gap: 20px; align-items: flex-start;">
<div style="width: 600px; flex-shrink: 0;">
<SciChartSurface @ref="_sciChartRef" HeightAspect="2" WidthAspect="3">
<XAxes>
<NumericAxis />
</XAxes>
<YAxes>
<NumericAxis />
</YAxes>
<MouseWheelZoomModifier />
<ZoomPanModifier />
</SciChartSurface>
</div>
</div>
- Run the application
SciChart.Blazor Nuget Readme
SciChart.Blazor is Blazor component library that wraps SciChart.js — a high-performance WebGL charting library — enabling its use in Blazor Server and Blazor WebAssembly applications.
Current version of nuget package supports only 2D charts, Polar Charts and Pie Charts are not supported at the moment. The package is based on SciChart.js version 6.0.6.
All charts that are in the library support initial creation and data append. However, only FastLineRenderableSeries has been well tested at the moment.
Getting Started
1. Install the package
dotnet add package SciChart.Blazor
2. Add the namespace import
In _imports.razor:
@using SciChart.Blazor.Components
3. Add a chart to your page
@page "/my-chart"
<SciChartSurface HeightAspect="2" WidthAspect="3">
<XAxes>
<NumericAxis />
</XAxes>
<YAxes>
<NumericAxis />
</YAxes>
<FastLineRenderableSeries Stroke="#FF6600" StrokeThickness="2" SeriesName="My Series">
<XyDataSeries XValues="@(new double[] { 0, 1, 2, 3, 4 })"
YValues="@(new double[] { 0, 1, 0.5, 1.5, 1 })" />
</FastLineRenderableSeries>
<MouseWheelZoomModifier />
<ZoomPanModifier />
</SciChartSurface>
Supported Chart Types
| Series |
Description |
FastLineRenderableSeries |
Line chart |
SplineLineRenderableSeries |
Smoothed spline line chart |
FastMountainRenderableSeries |
Filled mountain/area chart |
FastColumnRenderableSeries |
Bar/column chart |
FastCandlestickRenderableSeries |
Candlestick (OHLC) chart |
FastOhlcRenderableSeries |
OHLC chart |
FastBandRenderableSeries |
Band/range chart |
FastBubbleRenderableSeries |
Bubble chart |
XyScatterRenderableSeries |
Scatter chart |
FastImpulseRenderableSeries |
Impulse/stem chart |
FastErrorBarsRenderableSeries |
Error bars |
UniformHeatmapRenderableSeries |
Heatmap |
StackedColumnCollection |
Stacked columns |
StackedMountainCollection |
Stacked mountain |
| and more... |
|
Axis Types
NumericAxis
CategoryAxis
DateTimeNumericAxis
Chart Modifiers (Interactions)
MouseWheelZoomModifier — scroll to zoom
ZoomPanModifier — drag to pan
RubberBandXyZoomModifier — drag to zoom a region
RolloverModifier — cursor tooltip
ZoomExtentsModifier — double-click to fit chart
XAxisDragModifier / YAxisDragModifier — drag axes to pan/scale
DataPointSelectionModifier — click to select data points
LegendModifier — interactive chart legend
Appending Data at Runtime
Get a reference to a data series and call AppendRange:
<FastLineRenderableSeries Stroke="blue">
<XyDataSeries @ref="_series" />
</FastLineRenderableSeries>
@code {
XyDataSeries? _series;
async Task AppendData()
{
await _series!.AppendRange(
new double[] { 5, 6 },
new double[] { 1.2, 0.8 }
);
}
}
Events
<SciChartSurface OnSciChartSurfaceRendered="OnRendered">
<XAxes>
<NumericAxis OnVisibleRangeChanged="OnRangeChanged" />
</XAxes>
...
</SciChartSurface>
Requirements
License
Copyright (c) SciChart Ltd. All rights reserved.
See the SciChart licensing page for details.