Skip to main content

The Polar Band Series Type

The PolarBandRenderableSeriesπŸ“˜ creates a band or area between two polar curves, displaying the relationship between two sets of yValues on a polar coordinate system.

tip

The JavaScript Polar Band Chart can be found in theΒ SciChart.Js Examples Suite > Polar Band ChartΒ on Github, or our live demo atΒ scichart.com/demo.

Above: The JavaScript Polar Band Series Chart example from the SciChart.js Demo

Some of IPolarBandRenderableSeriesOptionsπŸ“˜'s key properties include:

Examples​

Basic Polar Band Series​

const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(divElementId, {
theme: new SciChartJsNavyTheme()
});

const angularXAxis = new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Angular,
visibleRange: new NumberRange(0, 8),
drawMinorGridLines: false
});
sciChartSurface.xAxes.add(angularXAxis);

const radialYAxis = new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Radial,
drawMinorGridLines: false,
labelPrecision: 0,
autoTicks: false,
majorDelta: 1,
innerRadius: 0.2
});
sciChartSurface.yAxes.add(radialYAxis);

// Define the polar band series
const baiscBand = new PolarBandRenderableSeries(wasmContext, {
dataSeries: new XyyDataSeries(wasmContext, {
xValues: [0, 1, 3, 4, 5, 6],
yValues: [1, 2, 3, 4, 5, 6],
y1Values: [6, 5, 1, 5, 4, 2]
}),
stroke: "rgba(200,200,30,1)", // yellow
fill: "rgba(200,200,30,0.3)", // thin yellow
strokeY1: "rgba(200,120,160,1)", // pink
fillY1: "rgba(200,120,160,0.3)", // thin pink
strokeThickness: 4,
interpolateLine: false
});
sciChartSurface.renderableSeries.add(baiscBand);

In the code above:

Gradient Fills in Polar Band Series​

To use Gradient Fills with a PolarBandRenderableSeriesπŸ“˜, you need to set the fillLinearGradientπŸ“˜ & fillLinearGradientY1πŸ“˜ properties with a GradientParamsπŸ“˜ object: a type which defines gradients by a number of TGradientStopπŸ“˜ objects inside an array and a start and end PointπŸ“˜.

const gradientBand = new PolarBandRenderableSeries(wasmContext, {
dataSeries: new XyyDataSeries(wasmContext, {
xValues: [0, 1, 2, 3, 4, 5],
yValues: [7, 4, 1, 5, 6, 7],
y1Values: [2, 5, 7, 3, 8, 2]
}),
stroke: "white",
strokeY1: "white",
strokeThickness: 2,
fillLinearGradient: new GradientParams(new Point(0, 0), new Point(0, 1), [
{ color: "#FF9999", offset: 0 },
{ color: "#FF2222", offset: 1 }
]),
// This one is for gradient where Y1 values are greater than Y2 values
fillLinearGradientY1: new GradientParams(new Point(0, 0), new Point(0, 1), [
{ color: "#2222FF", offset: 0 },
{ color: "#9999FF", offset: 1 }
]),
interpolateLine: true,
scaleGradientToYRange: false // set to true to have global gradient depending on Y axis range
});
sciChartSurface.renderableSeries.add(gradientBand);

In the code above:

PaletteProvider for Polar Band Series​

By extending DefaultPaletteProviderπŸ“˜ you can create a custom palette for your Polar Band Series, to achieve dynamic coloring based on data values. See more about this topic here Palette Provider API - Polar Band Series.