SciChart.js High Performance JavaScript Chart Library
SciChart.js is a high-performance JavaScript chart library (current stable version 5.1.4) engineered for demanding real-time and big-data visualization applications. It leverages WebGL2 and WebAssembly to render millions of data points smoothly, differentiating itself through exceptional speed and efficiency compared to alternatives like Chart.js, HighCharts, and Plotly. The library is actively maintained with frequent releases, including major versions like v5 that focus on significant performance improvements, smaller bundle sizes, and faster initialization. It is particularly suited for scientific, financial, medical, engineering, and enterprise applications requiring robust, feature-rich, and highly interactive charts.
Common errors
-
Sorry! This version of SciChart is too old to be used for the community edition. Please update to the latest version
cause Using a version of SciChart.js (specifically 3.2.446-3.2.555) with a known licensing bug, or a version released after your support expiry date with an outdated license.fixUpgrade SciChart.js to version 3.3.560 or later. If using a commercial license, ensure your developer subscription is active and your SciChart.js version was released within your support period. -
Runtime license is invalid: License is not valid for this domain.
cause The runtime license key provided for SciChart.js is not valid for the domain where the application is being hosted. This often happens in deployed environments.fixRegister the exact production domain(s) in your SciChart profile to generate a valid runtime key, then ensure that key is correctly applied in your application's `SciChartJSInitializer.initSciChart` call. -
WebGL is not supported on this browser or device.
cause SciChart.js v5+ explicitly requires WebGL 2. The client's browser or hardware may not support WebGL 2, or WebGL is disabled.fixEnsure the client is using a modern browser with WebGL 2 support (e.g., Chrome 56+, Edge 79+, Safari 15+, Firefox 51+). Check browser settings to confirm WebGL is enabled. Consider that older hardware might not support WebGL2.
Warnings
- breaking SciChart.js v5.x removed fallback support for WebGL 1. Applications now require WebGL 2 compatible browsers/hardware. This was done for performance reasons and to support future graphics APIs.
- breaking With the introduction of SIMD support in v5, projects using Webpack need to update their configuration to correctly include fallback WebAssembly (`scichart2d-nosimd.wasm` and `scichart3d-nosimd.wasm`) files if `SciChartDefaults.useWasmSimd` is set to `Auto` (the default).
- breaking The default native font for charts changed from Arial to Arimo in v5. If your application relies on the default font appearance, you may notice subtle visual changes.
- gotcha SciChart.js is commercial software. While a free community edition is available for personal, non-commercial, and educational use, commercial applications require a purchased license. Unlicensed commercial use will result in a 'Powered by SciChart' watermark and potential runtime limitations.
- deprecated Versions 3.2.446 through 3.2.555 contained a critical licensing bug that caused applications to display a 'license expired' error, even with a valid license, and have been marked as deprecated on npm.
Install
-
npm install scichart -
yarn add scichart -
pnpm add scichart
Imports
- SciChartSurface
const SciChartSurface = require('scichart').SciChartSurface;import { SciChartSurface } from 'scichart'; - SciChartJSInitializer
import { initSciChart } from 'scichart';import { SciChartJSInitializer } from 'scichart'; - NumericAxis
import { Axis } from 'scichart';import { NumericAxis } from 'scichart'; - FastLineRenderableSeries
import { LineSeries } from 'scichart';import { FastLineRenderableSeries } from 'scichart'; - XyDataSeries
import { DataSeries } from 'scichart';import { XyDataSeries } from 'scichart';
Quickstart
import {
SciChartSurface,
SciChartJSInitializer,
NumericAxis,
FastLineRenderableSeries,
XyDataSeries,
ENumericFormat,
EAutoRange,
EAxisAlignment
} from 'scichart';
// Ensure you have a div with id 'scichart-root' in your HTML
// <div id="scichart-root" style="width: 800px; height: 600px;"></div>
async function drawChart() {
// SciChart.js is commercial software. A free community edition is available.
// For commercial use, acquire a license key from scichart.com/licensing-scichart-js
// SciChartJSInitializer.initSciChart({ licenseKey: process.env.SCICHART_LICENSE_KEY ?? '' });
// Initialize SciChart.js - required once per application
await SciChartJSInitializer.initSciChart();
const { sciChartSurface, wasmContext } = await SciChartSurface.create('scichart-root');
// Create X and Y Axes
const xAxis = new NumericAxis(wasmContext, {
axisTitle: 'X-Axis Title',
labelFormat: ENumericFormat.Decimal,
labelPrecision: 1,
autoRange: EAutoRange.Always,
axisAlignment: EAxisAlignment.Bottom
});
const yAxis = new NumericAxis(wasmContext, {
axisTitle: 'Y-Axis Title',
labelFormat: ENumericFormat.Decimal,
labelPrecision: 2,
autoRange: EAutoRange.Always,
axisAlignment: EAxisAlignment.Left
});
sciChartSurface.xAxes.add(xAxis);
sciChartSurface.yAxes.add(yAxis);
// Create a DataSeries
const dataSeries = new XyDataSeries(wasmContext);
for (let i = 0; i < 100; i++) {
dataSeries.append(i, Math.sin(i * 0.1) * 10 + Math.random() * 2);
}
// Create a RenderableSeries and add the DataSeries
const renderableSeries = new FastLineRenderableSeries(wasmContext, {
dataSeries: dataSeries,
strokeThickness: 3,
stroke: 'steelblue'
});
sciChartSurface.renderableSeries.add(renderableSeries);
}
drawChart();