Axis Types

Demonstrates the Numeric, Category, Date and Logarithmic axis types available SciChart.js, High Performance JavaScript Charts

Fullscreen

Edit

 Edit

Docs

drawExample.ts

Copy to clipboard
Minimise
Fullscreen
1// Loading ... 

Axis Types Example in JavaScript

Overview

This example demonstrates how to configure and integrate different axis types in SciChart.js using JavaScript. It combines a variety of axes including a CategoryAxis with string text labels provided by a TextLabelProvider, a NumericAxis for numerical data with prefix and postfix formatting, a DateTimeNumericAxis that auto-formats dates based on the date range, and a LogarithmicAxis for log-scaled data.

Technical Implementation

The chart is constructed by creating a new SciChartSurface along with a WebAssembly context using the function SciChartSurface.create(). Multiple axes are programmatically added by instantiating their respective classes, for example, the CategoryAxis and DateTimeNumericAxis (see DateTimeNumericAxis for details). A custom palette provider (AxisTypesPaletteProvider) is implemented by overriding methods such as overrideFillArgb, in line with the guidelines provided in the PaletteProvider documentation.

Features and Capabilities

The example emphasizes high-performance rendering using fast renderable series like FastColumnRenderableSeries and FastLineRenderableSeries; these components are optimized for large datasets as described in the FastColumnRenderableSeries documentation. It also demonstrates asynchronous data integration, where real-time data is fetched and appended to XyDataSeries (DataSeries Append/Update), ensuring the chart remains responsive. Additionally, interactive chart modifiers such as ZoomPanModifier, MouseWheelZoomModifier, and ZoomExtentsModifier are incorporated to support dynamic zooming and panning functions (refer to Adding Zooming, Panning Behavior for more information).

Integration and Best Practices

Although this example is implemented in JavaScript, it is designed to be easily integrated into other frameworks, as seen in the accompanying React integration via the <SciChartReact/> component. Developers are encouraged to follow performance optimization techniques such as leveraging WebGL and WebAssembly for rapid rendering—topics covered in the Performance Tips & Tricks documentation. Furthermore, custom axis labeling is achieved using the TextLabelProvider, enabling developers to fully customize how string labels are displayed on a CategoryAxis (see TextLabelProvider for additional context). Overall, the example illustrates advanced features like real-time updates and custom styling, providing a comprehensive foundation for building high-performance financial charting applications with SciChart.js.

javascript Chart Examples & Demos

See Also: Chart Axis APIs (11 Demos)

JavaScript Chart with Multiple X Axes | SciChart.js Demo

JavaScript Chart with Multiple X Axes

Demonstrates Multiple X & Y Axis on a JavaScript Chart using SciChart.js. SciChart supports unlimited left, right, top, bottom X, Y axis with configurable alignment and individual zooming, panning

JavaScript Chart with Secondary Y Axes | SciChart.js Demo

JavaScript Chart with Secondary Y Axes

Demonstrates Secondary Y Axis on a JavaScript Chart using SciChart.js. SciChart supports unlimited, multiple left, right, top, bottom X, Y axis with configurable alignment and individual zooming, panning

JavaScript Vertical Charts | Javascript Charts | SciChart.js

JavaScript Vertical Charts

Demonstrates alignment of Axis to create a vertical chart with SciChart.js - JavaScript Charts.

JavaScript Chart with Central Axes | SciChart.js Demo

JavaScript Chart with Central Axes

Demonstrates Central Axes on a JavaScript Chart using SciChart.js. SciChart supports unlimited left, right, top, bottom X, Y axis with configurable layout

JavaScript Chart with Static X Axis | SciChart.js Demo

JavaScript Chart with Static X Axis

Demonstrates isStaticAxis on a JavaScript Chart using SciChart.js.

JavaScript Chart with Vertically Stacked Axes | SciChart

JavaScript Chart with Vertically Stacked Axes

Demonstrates Vertically Stacked Axes on a JavaScript Chart using SciChart.js, allowing data to overlap

JavaScript Chart with Logarithmic Axis Example | SciChart

JavaScript Chart with Logarithmic Axis Example

Demonstrates Logarithmic Axis on a JavaScript Chart using SciChart.js. SciChart supports logarithmic axis with scientific or engineering notation and positive and negative values

NEW!
JavaScript Chart with DiscontinuousDateAxis Comparison

DiscontinuousDateAxis Comparison with Javascript

NEW!
JavaScript Chart with BaseValue Axes | SciChart.js Demo

JavaScript Chart with BaseValue Axes

Demonstrates BaseValue Axes on a JavaScript Chart using SciChart.js to create non-linear and custom-scaled axes such as log-like scales

Draw JavaScript Chart Behind Axis | SciChart.js Demo

Draw JavaScript Chart Behind Axis

Demonstrates the option of the transparent Axes customization on a JavaScript Chart using SciChart.js.

JavaScript Chart Axis Layout Options | SciChart.js Demo

JavaScript Chart Axis Layout Options

Demonstrates outer, inner, central and stacked axes, and use of axis alignment to create vertical charts

SciChart Ltd, 16 Beaufort Court, Admirals Way, Docklands, London, E14 9XL.