Demonstrates how to add Annotations (shapes, boxes, lines, text) to a JavaScript Chart using SciChart.js, High Performance JavaScript Charts
This JavaScript example demonstrates how SciChart.js can be used to integrate various annotation types such as text, lines, boxes, and custom SVG shapes into high-performance 2D charts. The example showcases robust chart annotation capabilities that empower developers to create dynamic and interactive visualizations.
In this example, a SciChartSurface is created with numeric X and Y axes configured with defined visible ranges. Annotation types including TextAnnotation, NativeTextAnnotation, LineAnnotation, BoxAnnotation, and CustomAnnotation are applied using both absolute and relative coordinate modes for precise placement as explained in the Annotations API Documentation. Custom animations such as fade, typewriter, and rotation effects are implemented via the Generic Animations | JavaScript Chart Documentation API. Additionally, interactivity is enhanced using the ZoomPanModifier, enabling advanced zooming and panning behavior as detailed in the ZoomPanModifier tutorial. Custom SVG annotations, including a rocket icon and buy/sell markers, are leveraged to add unique graphical elements through the CustomAnnotation functionality.
The example features real-time update capabilities through smooth animations and dynamic content updates. It incorporates advanced features such as responsive layout via relative coordinate modes and sophisticated animation sequencing for engaging visual transitions. Performance optimizations are achieved by efficiently managing animation delays and rendering, in line with recommendations found in Performance Tips.
This implementation follows modular design principles by clearly separating chart creation and annotation configuration. Using JavaScript ensures the setup remains lightweight and straightforward to integrate into web projects. Developers are encouraged to build upon these techniques to create highly interactive charting applications with SciChart.js, leveraging the streamlined process and the extensive customization options available.

Demonstrates per-point coloring in JavaScript chart types with SciChart.js PaletteProvider API

Demonstrates how to place Buy/Sell arrow markers on a JavaScript Stock Chart using SciChart.js - Annotations API

Demonstrates how to add draggable thresholds which change the series color in the chart in SciChart.js

Demonstrates how to edit Annotations (shapes, boxes, lines, text, horizontal and vertical line) over a JavaScript Chart using SciChart.js Annotations API

Demonstrates how to color areas of the chart surface using background Annotations using SciChart.js Annotations API

Demonstrates how layering works a JavaScript Chart using SciChart.js Annotations API

Build Responsive JavaScript HTML Annotations with SciChart. Use the advanced CSS container queries for responsive text layout and custom design. View demo now.

JavaScript HTML Chart Control example demonstrates advanced HTML annotation integration and how to render HTML components within charts. Try the SciChart demo.