Zoom and Pan with React Chart multiple Modifiers

Demonstrates different Zoom and Pan Modifiers on a React Chart including Mousewheel, Pinchzoom, Rubber-band zoom.

Fullscreen

Edit

 Edit

Docs

drawExample.ts

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

Multiple Zoom Pan Modifiers - React

Overview

This example demonstrates how to create a high-performance, interactive chart in a React environment using SciChart.js. The chart showcases multiple zoom and pan behaviors including rubber-band zoom, pinch zoom, mouse-wheel zoom, and double-click zoom-to-fit. Data is dynamically generated via Fourier series, and the visual display is enriched with annotations to guide user interactions.

Technical Implementation

The implementation leverages the <SciChartReact/> component which integrates SciChart.js into React applications. The core of the example is defined in the drawExample function where a SciChartSurface is instantiated with configurable numeric axes and real-time series data. Multiple chart modifiers are added: the RubberBandXyZoomModifier (triggered on the right mouse button) applies an elastic easing function for smooth zoom animations, while the ZoomPanModifier (with pinch zoom enabled), MouseWheelZoomModifier, and ZoomExtentsModifier further enhance user interactivity. Developers can find more details on this approach in the React Charts with SciChart.js guide and explore zoom and pan specifics via the SciChart.js Zooming and Panning documentation.

Features and Capabilities

The chart features advanced zooming and panning capabilities that include rubber-band and pinch zoom along with mouse-wheel interactions and double-click zoom extents. It also incorporates animated transitions using an elastic easing function for a seamless user experience. Annotations, both text and native, are implemented to provide contextual instructions and enhance the user interface. Learn more about these advanced features on the SciChart.js Demo for Multiple Modifiers.

Integration and Best Practices

The example is implemented as a React component, using the <SciChartReact/> wrapper to initialize and render the chart. This encapsulates the chart creation process and allows for efficient resource management. Developers are encouraged to follow best practices for memory management by properly disposing of the SciChartSurface when unmounting components. For additional guidance on building robust React components with SciChart.js, see the How to Make Charts in React from Scratch? - SciChart article and related resource management tips.

react Chart Examples & Demos

See Also: Zoom and Pan a Chart (9 Demos)

React Chart with Multiple X Axes | React Charts | SciChart.js

React Chart with Multiple X Axes

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

React Chart with Secondary Y Axes | SciChart.js Demo

React Chart with Secondary Y Axes

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

Drag React Chart Axis to Scale or Pan | SciChart.js Demo

Drag React Chart Axis to Scale or Pan

Demonstrates how to Zoom, Scale or Pan individual Axis on a React Chart with SciChart.js AxisDragModifiers

Zoom and Pan a Realtime React Chart | SciChart.js Demo

Zoom and Pan a Realtime React Chart

Demonstrates how to zoom and pan a realtime React Chart while it is updating, with SciChart.js ZoomState API

Zoom and Pan with Overview Chart | React Charts | SciChart.js

Zoom and Pan with Overview Chart

Demonstrates how to zoom and pan with an Overview Chart

Virtualized React Charts: Load Data on Zoom/Pan | SciChart

Virtualized React Charts: Load Data on Zoom/Pan

shows how to load data on zoom/pan and how to create an overview chart for this case.

React Polar Modifiers | Polar Interactivity Modifiers

React Polar Modifiers | Polar Interactivity Modifiers Demo

Explore SciChart's Polar Interactivity Modifiers including zooming, panning, and cursor tracking. Try the demo to trial the Polar Chart Behavior Modifiers.

NEW!
High Precision Date Axis | React Charts | SciChart.js Demo

High Precision Date Axis

Demonstrates 64-bit precision Date Axis in SciChart.js handling Nanoseconds to Billions of Years

NEW!
React Overview for SubCharts with Range Selection | SciChart

React Overview for SubCharts with Range Selection

Demonstrates how to build synchronized multi-panel charts with an overview range selector using SciChart.js in React

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