Dashed Line Styling

Demonstrates how create JavaScript Charts with dashed lines using SciChart.js, High Performance JavaScript Charts

Fullscreen

Edit

 Edit

Docs

drawExample.ts

Copy to clipboard
Minimise
Fullscreen
1// Loading ... 

Dashed Line Styling - JavaScript

Overview

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.

Technical Implementation

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.

Features and Capabilities

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.

Integration and Best Practices

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.

javascript Chart Examples & Demos

See Also: Styling and Theming (11 Demos)

Chart Background Image with Transparency | SciChart.js

Chart Background Image with Transparency

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

Styling a JavaScript Chart in Code | SciChart.js Demo

Styling a JavaScript Chart in Code

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

Using Theme Manager in JavaScript Chart | SciChart.js

Using Theme Manager in JavaScript Chart

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

Create a Custom Theme for JavaScript Chart | SciChart.js

Create a Custom Theme for JavaScript Chart

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

Coloring Series per-point using the PaletteProvider

Coloring Series per-point using the PaletteProvider

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

JavaScript Point-Markers Chart | Javascript Charts | SciChart.js

JavaScript Point-Markers Chart

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

Data Labels | Javascript Charts | SciChart.js Demo

Data Labels

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

JavaScript Chart with Multi-Style Series | SciChart.js

JavaScript Chart with Multi-Style Series

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

JavaScript Chart with lines split by thresholds | SciChart

JavaScript Chart with lines split by thresholds

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

JavaScript Chart Title | Javascript Charts | SciChart.js Demo

JavaScript Chart Title

Demonstrates chart title with different position and alignment options

NEW!
JavaScript Order of Rendering | Javascript Charts | SciChart.js

JavaScript Order of Rendering Example

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.

SciChart Ltd, 16 Beaufort Court, Admirals Way, Docklands, London, E14 9XL.