Demonstrates how create JavaScript Charts with dashed lines using SciChart.js, High Performance JavaScript Charts
This example demonstrates the use of SciChart.js to create high performance dashed line charts using JavaScript. The focus is on rendering series with advanced dashed and dotted line styles along with gradient fills, providing a clear illustration of custom styling capabilities.
The chart is initialized asynchronously using SciChartSurface.create() in a dedicated drawExample function. Numeric axes are configured with custom label formatting and precision. Several renderable series are added including a mountain (area) series with a gradient fill implemented using GradientParams as described in The Mountain (Area) Series Type and multiple line series with varying strokeDashArray values to achieve dashed and dotted effects (refer to Series Styling - Dash Line Patterns for more details). Interactive modifiers such as ZoomPanModifier, MouseWheelZoomModifier, and ZoomExtentsModifier further enhance user interaction, while the use of the WebAssembly context (wasmContext) aids performance as noted in Performance Tips & Tricks.
The example highlights advanced styling techniques with a mountain series featuring a strokeDashArray: [10,5] dash pattern along with gradient fills, and additional line series using strokeDashArray: [5,5] and strokeDashArray: [3,3] patterns for dotted effects. A band series adds further visual context, and interactive modifiers provide real-time dynamic updates.
This JavaScript implementation exemplifies best practices for asynchronous chart initialization and resource management. Charts are created by invoking a single asynchronous method and are properly disposed of using sciChartSurface.delete(), in line with guidelines found in the Getting Started with SciChart JS and Memory Best Practices documentation.

Demonstrates how to create a JavaScript Chart with background image using transparency in SciChart.js

Demonstrates how to style a JavaScript Chart entirely in code with SciChart.js themeing API

Demonstrates our Light and Dark Themes for JavaScript Charts with SciChart.js ThemeManager API

Demonstrates how to create a Custom Theme for a SciChart.js JavaScript Chart using our Theming API

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

Demonstrates the different point-marker types for JavaScript Scatter charts (Square, Circle, Triangle and Custom image point-marker)

Show data labels on JavaScript Chart. Get your free demo now.

Demonstrates how to apply multiple different styles to a single series using RenderDataTransform

Demonstrates how to use a RenderDataTransform to split lines into multiple segments so they can be individually colored according to thresholds

Demonstrates chart title with different position and alignment options

The JavaScript Order of Rendering example gives you full control of the draw order of series and annotations for charts. Try SciChart's advanced customizations.