Radar chart
Compare measure values across categories on radial axes with the RadarChart component.
A radar chart (also known as a spider chart or web chart) displays measure values on radial axes that radiate from a common center point. Each value of the trendBy attribute becomes a spoke, and each measure — or each value of the segmentBy attribute — is drawn as a polygon connecting the points along those spokes. Use it to compare profiles across several categories, for example, scores across competencies.
RadarChart is @alpha: its shape is likely to change outside of the usual SemVer guarantees. See API maturity before you depend on it.Buckets
| Prop | Required | Takes | What it does |
|---|---|---|---|
measures | Yes | One or more measures | Draws one polygon per measure. |
trendBy | No | One attribute | Creates one spoke per attribute value. |
segmentBy | No | One attribute | Splits the measure into one polygon per attribute value. Use it with a single measure. |
filters | No | Filters | Limits the data the radar chart shows. |
For code samples of both layouts, see Usage patterns.
Sorting
RadarChart applies no default sorting. To sort the data, pass sort items in the sortBy prop. See Sort items.
Configuration
Pass these options in the config prop. See Chart configuration for details.
| Option | What it changes |
|---|---|
colors, colorPalette, colorMapping | Colors of the polygons, one per measure or per segmentBy value. |
chartFill | type sets how the polygons are filled: "solid", "pattern", or "outline". The polygon borders keep their solid color. |
legend | Whether the legend shows and where. The legend shows only with two or more polygons. |
xaxis, yaxis | xaxis.labelsEnabled shows or hides the trendBy value labels around the chart. yaxis.labelsEnabled shows or hides the labels of the value scale, and yaxis.min and yaxis.max set its range. |
grid | enabled shows or hides the grid lines of the value scale. |
dataLabels | visible shows or hides the labels. style: "backplate" adds a background behind them. |
dataPoints | visible shows or hides the dot at each data point. |
continuousLine | enabled: true connects the polygon across missing values. |
enableCompactSize | Hides the spoke and scale labels in small containers. |
separators | Thousands and decimal separators in the number format. |
Limits
- A radar chart renders up to 10,000 polygons and up to 10,000
trendByvalues. With more, the chart shows an error andonErrorreceives aDataTooLargeToDisplaySdkError. Filter the data to fit. - A radar chart doesn’t show axis names, even with
xaxis.name.visibleoryaxis.name.visibleset totrue. - Radar charts are easiest to read with a small number of spokes, typically three to eight. Too many
trendByvalues make the polygons hard to read.
Usage patterns
Multiple measures
When you specify two or more measures, the radar chart draws one polygon per measure, all sharing the same spokes:
<RadarChart
measures={[Md.$Revenue, Md.$Costs]}
trendBy={Md.Quarter}
/>
Single measure segmented by attribute
When you specify a single measure together with segmentBy, the radar chart draws one polygon per value of the segmentBy attribute instead:
<RadarChart
measures={[Md.$Revenue]}
trendBy={Md.Quarter}
segmentBy={Md.Region}
/>
Structure
import "@gooddata/sdk-ui-charts/styles/css/main.css";
import { RadarChart } from "@gooddata/sdk-ui-charts";
<RadarChart
measures={<measures>}
trendBy={<attribute>}
segmentBy={<attribute>}
config={<chart-config>}
…
/>
Example
import "@gooddata/sdk-ui-charts/styles/css/main.css";
import { RadarChart } from "@gooddata/sdk-ui-charts";
import * as Md from "./catalog.js";
const style = { height: 300 };
<div style={style}>
<RadarChart
measures={[Md.$NrOfOpportunities, Md.$NrOfWonOpportunities]}
trendBy={Md.Region}
/>
</div>
Props
| Prop | Type | Required | Description | Inherited from |
|---|---|---|---|---|
measures | AttributesMeasuresOrPlaceholders | Yes | Specify one or more measures whose values will be displayed on the radar chart. | IRadarChartBucketProps |
backend | IAnalyticalBackend | No | Analytical backend, from which the chart will obtain data to visualize If you do not specify instance of analytical backend using this prop, then you MUST have BackendProvider up in the component tree. | IBucketChartProps |
config | IChartConfig | No | Configure chart’s behavior and appearance. | ICommonChartProps |
drillableItems | ExplicitDrill[] | No | Configure drillability; e.g. which parts of the visualization can be interacted with. | IVisualizationProps |
ErrorComponent | ComponentType<IErrorProps> | No | React component to display in the event when there is an error with either obtaining the data from backend or with the data itself. | IVisualizationProps |
execConfig | IExecutionConfig | No | Execution configuration, will provide the execution with necessary config before initiating execution. | ICommonChartProps |
exportTitle | string | No | Set title to use for exported files. | IVisualizationProps |
filters | NullableFiltersOrPlaceholders | No | Specify filters to apply on the data to chart. | IRadarChartBucketProps |
height | number | No | Set height of the chart (in pixels). | ICommonChartProps |
LoadingComponent | ComponentType<ILoadingProps> | No | React component to display while loading data from the backend. | IVisualizationProps |
locale | string | No | Set Locale for visualization localization. | IVisualizationProps |
onDataView | OnDataView | No | Called when the visualization loads a DataView, i.e. it receives data from the backend. | IVisualizationCallbacks |
onDrill | OnFiredDrillEvent | No | Called when user triggers a drill on a visualization. | IVisualizationCallbacks |
onError | OnError | No | Called when an error occurs while loading data for the visualization. | IVisualizationCallbacks |
onExportReady | OnExportReady | No | Called when the visualization is ready to be exported. | IVisualizationCallbacks |
onLegendReady | OnLegendReady | No | Called when legend is rendered. | IChartCallbacks |
onLoadingChanged | OnLoadingChanged | No | Called when loading status of the visualization changes - vis starts or stops loading | IVisualizationCallbacks |
placeholdersResolutionContext | any | No | Resolution context for composed placeholders. | IRadarChartBucketProps |
segmentBy | AttributeOrPlaceholder | No | Specify single attribute whose values will be used to segment the measure values. | IRadarChartBucketProps |
sortBy | SortsOrPlaceholders | No | Specify how to sort the data to chart. | IRadarChartBucketProps |
trendBy | AttributeOrPlaceholder | No | Specify single attribute whose values will be used to create the radar spokes (axes). | IRadarChartBucketProps |
width | number | No | Set width of the chart (in pixels). | ICommonChartProps |
workspace | string | No | Identifier of analytical workspace, from which the chart will obtain data to visualize. If you do not specify workspace identifier, then you MUST have WorkspaceProvider up in the component tree. | IBucketChartProps |
Related
Display vertical bar comparisons with the ColumnChart component.
Display data trends as connected points with the LineChart component.
Configure chart appearance, axes, legends, colors, and data labels.
Shared behavior of GoodData.UI visual components — responsive sizing, the style and data props model, and the visualization lifecycle callbacks.