# React Native Radar Chart (Pro)

> A React Native radar (spider) chart for iOS, Android and the web: several measures on spokes, one filled outline per series, polygon or circle rings, outlines that reshape to new data, legend toggles, tooltips per spoke and a screen-reader summary of each series' strongest and weakest measure.

# Radar chart Pro

Several measures of a few things, on spokes around a centre: two phones' specs, a player's skills, a team's strengths. Each row is a spoke (three or more), each series an outline. Hover, press or arrow round the spokes for every series' value on one; screen readers hear each series' strongest and weakest measure.

```tsx
import { RadarChart } from '@patine-ui/pro';
```

## Live data

```tsx live
import { useState } from 'react';
import { View } from 'react-native';
import { Button } from 'patine-ui';
import { RadarChart } from '@patine-ui/pro';

const skills = ['Speed', 'Battery', 'Camera', 'Display', 'Price', 'Storage'];
const roll = () => skills.map((skill) => ({ skill, pro: 50 + Math.round(Math.random() * 50), lite: 30 + Math.round(Math.random() * 60) }));

export default function Example() {
  const [data, setData] = useState(roll);
  return (
    <View style={{ width: 380, gap: 8 }}>
      <Button size="sm" variant="outline" onPress={() => setData(roll())} style={{ alignSelf: 'flex-end' }}>Shuffle</Button>
      <RadarChart
        data={data}
        nameKey="skill"
        series={[{ key: 'pro', label: 'Phone Pro' }, { key: 'lite', label: 'Phone Lite', dashed: true }]}
        max={100}
        height={300}
        accessibilityLabel="Phone Pro against Phone Lite"
      />
    </View>
  );
}
```

## Example: an interview scorecard

A hiring team compares two finalists on the same five skills, scored 1 to 5 by the panel. One shape against the other shows who's strong where.

```tsx live wide
import { View } from 'react-native';
import { RadarChart } from '@patine-ui/pro';

const SCORES = [
  { skill: 'Coding', amara: 4.5, jonas: 4 },
  { skill: 'System design', amara: 3.5, jonas: 4.5 },
  { skill: 'Communication', amara: 5, jonas: 3 },
  { skill: 'Product sense', amara: 4, jonas: 3.5 },
  { skill: 'Collaboration', amara: 4.5, jonas: 4 },
];

export default function Example() {
  return (
    <View style={{ width: '100%', maxWidth: 480 }}>
      <RadarChart
        data={SCORES}
        nameKey="skill"
        series={[{ key: 'amara', label: 'Amara O.' }, { key: 'jonas', label: 'Jonas W.', dashed: true }]}
        max={5}
        levels={5}
        height={320}
        accessibilityLabel="Interview scores for Amara and Jonas"
      />
    </View>
  );
}
```

## Props

The [shared chart props](./charts#shared-props), and:

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `nameKey` | `string` | — | The row field naming each spoke. |
| `series` | `{ key, label?, color?, dashed? }[]` | — | One outline per series. |
| `max` | `number` | a round number over the largest value | The outer ring. |
| `levels` | `number` | `4` | Rings. |
| `gridShape` | `'polygon' \| 'circle'` | `'polygon'` | |
| `fill` | `boolean` | `true` | Fill each outline. |
| `defaultHidden` | `string[]` | — | Series turned off at first. |
