Demonstrates how to create tooltips on mouse-over using SciChart.js, High Performance JavaScript Charts
This example demonstrates how to create an interactive chart using SciChart.js in a pure JavaScript environment. It showcases the creation of a SciChartSurface with customized numeric axes, data series rendered from Fourier series data, and advanced interactivity through custom tooltip behaviors.
The chart is initialized by asynchronously creating a SciChartSurface and setting up numeric axes with properties such as growBy, labelFormat, and labelPrecision (see the NumericAxis documentation for more details). Three separate FastLineRenderableSeries are added, each using an EllipsePointMarker to draw data points. Custom tooltip templates and legends are implemented by configuring a RolloverModifier, which overrides the default tooltip behavior as detailed in the RolloverModifier documentation. Additional interactive behaviors are provided with zooming and panning modifiers such as ZoomPanModifier, ZoomExtentsModifier, and MouseWheelZoomModifier (refer to the ZoomPanModifier documentation for implementation guidance). WebAssembly is leveraged via the wasmContext to enhance performance, with more optimization techniques described in the Performance Tips & Tricks documentation.
This example highlights advanced features including real-time tooltip customization and dynamic legend templates. The custom tooltips display formatted x and y values along with a tailored legend rendered using inline SVG, enhancing data readability. Such capabilities are critical for interactive data analysis and can be further explored in the Adding Tooltips and Legends tutorial.
The implementation follows best practices in resource management by providing a dedicated destructor that calls sciChartSurface.delete() to properly dispose of the chart instance, as recommended in the Memory Best Practices guide. By integrating Fourier series data with custom point markers and interactivity through various chart modifiers, the example offers a comprehensive solution without relying on any framework-specific hooks or builder APIs. Developers can refer to the SciChart.js User Manual for further insights on extending these techniques.

Demonstrates Hit-Testing a JavaScript Chart - point and click on the chart and get feedback about what data-points were clicked

Demonstrates adding a Cursor (Crosshair) to a JavaScript Chart with SciChart.js CursorModifier

Demonstrates adding Tooltips at certain positions to a JavaScript Chart with SciChart.js VerticalSliceModifier

Demonstrates using MetaData in a JavaScript Chart - add custom data to points for display or to drive visual customisation

Demonstrates Hit-Testing a JavaScript Chart - point and click on the chart and get feedback about what data-points were clicked

Demonstrates the DatapointSelectionModifier, which provides a UI to select one or many data points, and works with DataPointSelectionPaletteProvider to change the appearance of selected points

Demonstrates how to customise the tooltips for Rollover, Cursor and VerticalSlice modifiers in a JavaScript Chart with SciChart.js