SciChart.js High Performance JavaScript Chart Library

5.1.4 · active · verified Sun Apr 19

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

Warnings

Install

Imports

Quickstart

This quickstart initializes SciChart.js, creates a 2D chart surface within a specified HTML element, adds numeric X and Y axes, and then plots a simple FastLineRenderableSeries with generated sine wave data. It demonstrates the core setup for a basic chart.

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();

view raw JSON →