Demonstrates how to add Series Selection to a chart using SciChart.js, High Performance JavaScript Charts
This example demonstrates how to implement interactive series selection and hover events in SciChart.js using JavaScript. Multiple renderable series are added to a chart and enhanced with custom event handlers to provide visual feedback when a series is hovered or selected. Developers can learn more about these capabilities by exploring the Series Selection documentation and the [SeriesSelectionModifier] TypeDoc API(https://www.scichart.com/documentation/js/v5/typedoc/classes/seriesselectionmodifier.html) reference.
The chart is initialized by calling SciChartSurface.create() with a WebAssembly context, and NumericAxis components are added to provide dynamic scaling with a customizable NumberRange. A SeriesSelectionModifier is added to the chart and onHoveredChanged and onSelectedChanged event handlers are implemented to adjust the opacity and stroke color of each series. In particular, the example uses GenericAnimation to smoothly transition visual properties when series are hovered, while other series are dimmed to emphasize the active one. Annotations such as TextAnnotation are added to display instructions and, together with a LegendModifier, help provide a legend which adds context to the data.
This example highlights several advanced features of SciChart.js including:
SeriesSelectionModifier, enabling both hover and click-based selection events.GenericAnimation, allowing dynamic changes in opacity and stroke color.LegendModifier for clear data series labeling.SciChartSurface, following best practices detailed in the Getting Started with SciChart JS guide.While this example is implemented using JavaScript, it demonstrates patterns that are easily transferable to frameworks like React, Angular, or Vue. Developers are encouraged to follow efficient performance practices by leveraging the WebAssembly context (wasmContext) for processing large datasets, as showcased in the SciChart.js Performance Demo.
This comprehensive example serves as a practical guide for adding interactivity and advanced visual customizations to SciChart.js charts using plain JavaScript while adhering to best practices for performance optimization and resource management.

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

Demonstrates adding Tooltips on mouse-move to a JavaScript Chart with SciChart.js RolloverModifier

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 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