Polar Chart in TypeScript Charts

18 Nov 20184 minutes to read

Polar Chart

To render a polar series in your chart, you need to follow a few steps to configure it correctly. Here’s a concise guide on how to do this:

  • Set the series type: Define the series type as Polar in your chart configuration. This indicates that the data should be represented as a polar chart, which is ideal for plotting data points on a circular graph.

Binding data with series

You can bind data to the chart using the dataSource property within the series configuration. This allows you to connect a JSON dataset or remote data to your chart. To display the data correctly, map the fields from the data to the chart series xName and yName properties.

Draw types

Use the drawType property to change the series plotting type in a Polar chart to line, column, area, range column, spline, scatter, stacking area, spline area, or stacking column. The default value of drawType is Line.

Line

To render a line draw type, you need to follow a few steps to configure it correctly.

  • Set the series type: Define the series drawType as Line in your chart configuration. This indicates that the data should be represented as a polar line chart, with lines connecting each data point.

Spline

To render a spline draw type, you need to follow a few steps to configure it correctly.

  • Set the series type: Define the series drawType as Spline in your chart configuration. This indicates that the data should be represented as a polar spline chart, with smooth, curved lines connecting each data point.

Area

To render an area draw type, you need to follow a few steps to configure it correctly.

  • Set the series type: Define the series drawType as Area in your chart configuration. This indicates that the data should be represented as a polar area chart, with filled areas below the lines connecting each data point.

Stacked area

To render a stacked area draw type, you need to follow a few steps to configure it correctly.

  • Set the series type: Define the series drawType as StackingArea in your chart configuration. This indicates that the data should be represented as a polar stacked area chart, with areas stacked on top of each other, displaying the cumulative value of multiple series.

Column

To render a column draw type, you need to follow a few steps to configure it correctly.

  • Set the series type: Define the series drawType as Column in your chart configuration. This indicates that the data should be represented as a polar column chart, allowing for the comparison of values across categories.

Stacked column

To render a stacked column draw type, you need to follow a few steps to configure it correctly.

  • Set the series type: Define the series drawType as StackingColumn in your chart configuration. This indicates that the data should be represented as a polar stacked column chart, with each column consisting of multiple segments stacked on top of each other.

Range column

To render a range column draw type, you need to follow a few steps to configure it correctly.

  • Set the series type: Define the series drawType as RangeColumn in your chart configuration. This indicates that the data should be represented as a polar range column chart, where each column spans a range of values.

Scatter

To render a scatter draw type, you need to follow a few steps to configure it correctly.

  • Set the series type: Define the series drawType as Scatter in your chart configuration. This indicates that the data should be represented as a polar scatter chart.

Spline area

To render an spline area draw type, you need to follow a few steps to configure it correctly.

  • Set the series type: Define the series drawType as SplineArea in your chart configuration. This indicates that the data should be represented as a polar spline area chart, where the series is drawn with smooth, curved lines connecting each data point, and the area beneath the line is filled with color.

Series customization

Start angle

You can customize the start angle of the polar series using startAngle property. By default, startAngle is 0 degree.

Radius

You can customize the radius of the polar series using coefficient property. By default, coefficient is 100.

Empty points

Data points with null or undefined values are considered empty. Empty data points are ignored and not plotted on the chart.

Mode

Use the mode property to control handling of empty points. Available modes: Gap, Drop, Zero, Average. The default mode is Gap.

Fill

Use the fill property to set the fill color for empty points.

Border

Use the border property to customize the border width and color for empty points.

Events

Series render

The seriesRender event enables modification of series properties (for example, data, fill, or name) immediately before rendering. Use this event to adjust series appearance or to dynamically swap data sources.

Point render

The pointRender event provides a hook to customize each data point (for example, marker shape, border, or fill) before it is drawn. Use this to apply per-point styling rules or conditional formatting.

See also