ChartRadar
The ChartRadar component displays data as a radar chart with customizable styling, tooltips, and legends. Built with ApexCharts.
import { ChartRadar } from '@fintech-sandpit/ui/react';
const data = [ { name: 'Speed', productA: 85, productB: 70 }, { name: 'Reliability', productA: 90, productB: 75 }, { name: 'Comfort', productA: 75, productB: 80 },];
const series = [ { name: 'Product A', dataKey: 'productA' }, { name: 'Product B', dataKey: 'productB' },];
return ( <ChartRadar data={data} series={series} height="400px" showTooltip={true} showLegend={true} />);<script setup lang="ts">import { ChartRadar } from '@fintech-sandpit/ui/vue';
const data = [ { name: 'Speed', productA: 85, productB: 70 }, { name: 'Reliability', productA: 90, productB: 75 }, { name: 'Comfort', productA: 75, productB: 80 },];
const series = [ { name: 'Product A', dataKey: 'productA' }, { name: 'Product B', dataKey: 'productB' },];</script>
<template> <ChartRadar :data="data" :series="series" height="400px" :show-tooltip="true" :show-legend="true" /></template>ChartRadar
Section titled “ChartRadar”| Name | Type | Default | Description |
|---|---|---|---|
data | ChartRadarDataItem[] | — | Array of data objects where each object represents a data point with name and multiple value properties |
series | Array<{ name: string; dataKey: string }> | — | Array of series objects defining which data keys to display as radar lines |
width | CssUnit | '100%' | Width of the chart container (CSS unit string like ‘100%’, ‘400px’, ‘50rem’) |
height | CssUnit | '400px' | Height of the chart container (CSS unit string like ‘400px’, ‘50vh’) |
legendPosition | LegendPosition | 'bottom' | Position of the legend |
showTooltip | boolean | true | Whether to display tooltips on hover |
showLegend | boolean | true | Whether to display the legend |
colors | string[] | — | Array of colors for the chart lines |
| Name | Type | Default | Description |
|---|---|---|---|
data | ChartRadarDataItem[] | — | Array of data objects where each object represents a data point with name and multiple value properties |
series | Array<{ name: string; dataKey: string }> | — | Array of series objects defining which data keys to display as radar lines |
width | CssUnit | '100%' | Width of the chart container (CSS unit string like ‘100%’, ‘400px’, ‘50rem’) |
height | CssUnit | '400px' | Height of the chart container (CSS unit string like ‘400px’, ‘50vh’) |
legend-position | LegendPosition | 'bottom' | Position of the legend |
show-tooltip | boolean | true | Whether to display tooltips on hover |
show-legend | boolean | true | Whether to display the legend |
colors | string[] | — | Array of colors for the chart lines |
type CssUnit = `${number}${'px' | 'em' | 'rem' | 'vw' | 'vh' | 'vmin' | 'vmax' | '%'}`
type LegendPosition = 'top' | 'bottom' | 'left' | 'right'
type ChartRadarDataItem = { name: string; [key: string]: string | number;}