The Polar Mountain Chart Type
The PolarMountainRenderableSeriesπ is a type of renderable series that displays data in a polar mountain format.
tip
The JavaScript Polar Mountain Chart can be found in theΒ SciChart.Js Examples Suite > Polar Mountain ChartΒ on Github, or our live demo atΒ scichart.com/demo.
Above: The JavaScript Polar Mountain Series Chart example from the SciChart.js Demo
Propertiesβ
Some of IPolarMountainRenderableSeriesOptionsπ's key properties include:
- dataSeriesπ - The XyDataSeriesπ containing
xValuesandyValuesarrays - strokeπ - Stroke color for the line
- strokeThicknessπ - Thickness of the line
- interpolateLineπ - When true, line segments draw as arcs instead of straight lines
- clipToTotalAngleπ - When true, clips data outside the total angle range
- pointMarkerπ - Optional markers to display at data points
- paletteProviderπ - Custom coloring provider for dynamic styling
- dataLabelsπ - Configuration for optional data labels on points
Create a Basic Polar Mountain Seriesβ
To create a Javascript Polar Mountain Seriesπ with SciChart.js, use the following code:
- Creating a Polar Mountain Series
// Demonstrates how to create a basic polar mountain chart using SciChart.js
const {
SciChartPolarSurface,
SciChartJsNavyTheme,
PolarNumericAxis,
PolarMountainRenderableSeries,
EPolarAxisMode,
EAxisAlignment,
NumberRange,
XyDataSeries,
EPolarLabelMode
} = SciChart;
// or, for npm, import { SciChartSurface, ... } from "scichart"
const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(divElementId, {
theme: new SciChartJsNavyTheme(),
});
const angularXAxis = new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Angular,
axisAlignment: EAxisAlignment.Top,
visibleRange: new NumberRange(0, 19),
polarLabelMode: EPolarLabelMode.Parallel,
});
sciChartSurface.xAxes.add(angularXAxis);
const radialYAxis = new PolarNumericAxis(wasmContext, {
axisAlignment: EAxisAlignment.Right,
polarAxisMode: EPolarAxisMode.Radial,
visibleRange: new NumberRange(0, 8),
labelPrecision: 0,
});
sciChartSurface.yAxes.add(radialYAxis);
const polarMountain = new PolarMountainRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext, {
xValues: Array.from({ length: 20 }, (_, i) => i),
yValues: Array.from({ length: 20 }, (_, i) => Math.sin(i) * 3 + 4),
}),
stroke: "pink",
strokeThickness: 4,
interpolateLine: false, // set to true for rounded lines
});
sciChartSurface.renderableSeries.add(polarMountain);
In the code above:
- We create a PolarMountainRenderableSeriesπ instance and append it to the renderableSeries collection.
- Add an XyDataSeriesπ to the series, which stores the Xy data to render.
- Note that the line wraps for 1 and a half turns around the angular axis, since it calculates xValues as
xVal % visibleRange.maxand visible range is fixed to (0, 8)