Whenever the visible range changes, the chart requests data from the server, which returns a reduced view of the dataset, in this case using a very simple take every nth point method. The overview is created manually because it does not share data with the main chart but has a reduced view of the entire dataset.
This example demonstrates how to build a high-performance chart using SciChart.js with a virtualized data approach in JavaScript. The implementation includes a main chart that dynamically loads data based on the xAxis.visibleRange and an overview chart that provides context for the current view.
The chart is initialized via the SciChartSurface.create() method, where numeric axes with defined visible ranges are configured. Large datasets are efficiently managed using XyDataSeries and rendered with FastLineRenderableSeries. An overview scrollbar is added to the chart using SciChartOverview.create(). As the chart is zoomed or scrolled, data is fetched from REST endpoints using the fetch API, and the number of loaded data points is adjusted based on the chart's DOM canvas width, thus optimizing performance as described in the JavaScript Chart with Virtualized Data 10 Million Points example. Visible range updates are handled by subscribing to visibleRangeChanged on the x-axis and debouncing these events using RxJS’s debounceTime operator, ensuring that data updates occur smoothly.
The example offers real-time update capabilities through dynamic data fetching whenever the user pans or zooms the chart. Smooth animated transitions are achieved using easing functions (e.g., easing.outExpo) for axis updates. In addition, error handling is managed by displaying an error message on the chart using NativeTextAnnotation when data fetching fails; further details can be found in the NativeTextAnnotation documentation.
Even though this example is built using JavaScript, it integrates interactive features such as zooming and panning through modifiers like ZoomExtentsModifier, ZoomPanModifier, XAxisDragModifier, and YAxisDragModifier. This aligns with best practices for creating responsive and interactive charts. Developers are encouraged to review the ZoomPanModifier and ZoomExtentsModifier documentation to fully leverage these features. Performance optimization techniques, as discussed in the Performance Tips & Tricks guide, further enhance the chart’s responsiveness when dealing with large datasets.
Overall, this example showcases an effective approach to rendering large datasets with virtualized data, real-time updates, and robust interactivity, providing a strong foundation for building advanced visualizations with SciChart.js in a JavaScript environment.

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

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

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

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

Demonstrates how to use multiple Zoom and Pan Modifiers on a JavaScript Chart with SciChart.js

Demonstrates how to zoom and pan with an Overview Chart

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

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

Demonstrates how to create multiple synchronized subcharts with an overview range selector using SciChart.js and SubSurfaces