| Prop |
Type |
Description |
Default value |
| circular |
boolean |
|
false |
| gridConfig |
GridConfig |
|
|
| data |
number[] |
|
[] |
| maxValue |
number |
maximum data value that the radar chart can render |
max(...data) |
| noOfSections |
number |
number of cocentric polygons/circle that depict the number of levels in the grid |
4 |
| chartSize |
number |
size of the chart |
300 |
| labelConfig |
LabelConfig |
|
|
| labelConfigArray |
LabelConfig[] |
|
|
| labels |
string[] |
|
|
| dataLabels |
string[] |
label texts at the polygon vertices |
|
| dataLabelsConfigArray |
LabelConfig[] |
|
|
| showdataValuesAsLabels |
boolean |
|
|
| polygonConfig |
PolygonConfig |
|
|
| asterLinesConfig |
AsterLinesConfig |
|
|
| hideAsterLines |
boolean |
|
|
| hideGrid |
boolean |
|
|
| hideLabels |
boolean |
|
|
| dataLabelsConfig |
LabelConfig |
|
|
| labelsPositionOffset |
number |
|
5 |
| dataLabelsPositionOffset |
number |
|
5 |
| isAnimated |
boolean |
|
false |
| animationDuration |
number |
|
800 |
| animateTogether |
boolean |
|
false |
| startAngle |
number |
Angle in degrees from the horizontal (X-axis) for the first item |
0 |
| isClockWise |
boolean |
Whether the angles move in clockwise direction (default is anti-clock) |
false |
| chartContainerProps |
RadarChartContainerProps |
to set height, width, shiftX, shiftY, backgroundColor of the radar chart's container |
{} |
type GridConfig = {
stroke?: string;
strokeWidth?: number;
strokeDashArray?: number[];
fill?: string;
gradientColor?: string;
showGradient?: boolean;
opacity?: number;
gradientOpacity?: number;
gridSections?: GridSectionConfig[]; // GridSectionConfig is defined below
};
type GridSectionConfig = {
stroke?: string;
strokeWidth?: number;
strokeDashArray?: number[];
fill?: string;
gradientColor?: string;
showGradient?: boolean;
opacity?: number;
gradientOpacity?: number;
};
type LabelConfig = {
fontSize?: number;
stroke?: string;
textAnchor?: string;
alignmentBaseline?: string;
fontWeight?: string;
fontFamily?: string;
};
type PolygonConfig = {
stroke?: string;
strokeWidth?: number;
strokeDashArray?: number[];
fill?: string;
gradientColor?: string;
showGradient?: boolean;
opacity?: number;
gradientOpacity?: number;
showDataValuesAsLabels?: boolean;
isAnimated?: boolean;
animationDuration?: number;
};
type AsterLinesConfig = {
stroke?: string;
strokeWidth?: number;
strokeDashArray?: number[];
};
type RadarChartContainerProps = {
height?: number; // default: chartSize
width?: number; // default: chartSize
shiftX?: number; // default: 0
shiftY?: number; // default: 0
backgroundColor?: ColorValue; // default: 'transparent'
};