parent
0dd513fe7f
commit
a9027fdee6
1 changed files with 60 additions and 0 deletions
@ -0,0 +1,60 @@ |
||||
import React, { PureComponent } from 'react'; |
||||
import { Radar, RadarChart, PolarGrid, Legend, PolarAngleAxis, PolarRadiusAxis, ResponsiveContainer } from 'recharts'; |
||||
|
||||
const data = [ |
||||
{ |
||||
subject: 'Math', |
||||
A: 120, |
||||
B: 110, |
||||
fullMark: 150, |
||||
}, |
||||
{ |
||||
subject: 'Chinese', |
||||
A: 98, |
||||
B: 130, |
||||
fullMark: 150, |
||||
}, |
||||
{ |
||||
subject: 'English', |
||||
A: 86, |
||||
B: 130, |
||||
fullMark: 150, |
||||
}, |
||||
{ |
||||
subject: 'Geography', |
||||
A: 99, |
||||
B: 100, |
||||
fullMark: 150, |
||||
}, |
||||
{ |
||||
subject: 'Physics', |
||||
A: 85, |
||||
B: 90, |
||||
fullMark: 150, |
||||
}, |
||||
{ |
||||
subject: 'History', |
||||
A: 65, |
||||
B: 85, |
||||
fullMark: 150, |
||||
}, |
||||
]; |
||||
|
||||
export default class Example extends PureComponent { |
||||
static demoUrl = 'https://codesandbox.io/s/radar-chart-specified-domain-mfl04'; |
||||
|
||||
render() { |
||||
return ( |
||||
<ResponsiveContainer width="100%" height="100%"> |
||||
<RadarChart cx="50%" cy="50%" outerRadius="80%" data={data}> |
||||
<PolarGrid /> |
||||
<PolarAngleAxis dataKey="subject" /> |
||||
<PolarRadiusAxis angle={30} domain={[0, 150]} /> |
||||
<Radar name="Mike" dataKey="A" stroke="#8884d8" fill="#8884d8" fillOpacity={0.6} /> |
||||
<Radar name="Lily" dataKey="B" stroke="#82ca9d" fill="#82ca9d" fillOpacity={0.6} /> |
||||
<Legend /> |
||||
</RadarChart> |
||||
</ResponsiveContainer> |
||||
); |
||||
} |
||||
} |
Loading…
Reference in new issue