2018-06-23 17:21:49 +00:00
|
|
|
import {
|
|
|
|
|
PieChart, Pie, ResponsiveContainer, Tooltip
|
|
|
|
|
} from 'recharts';
|
2018-06-23 07:57:51 +00:00
|
|
|
import * as React from 'react';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export class Chart extends React.Component<any, any> {
|
|
|
|
|
constructor(props: any) {
|
|
|
|
|
super(props);
|
|
|
|
|
}
|
|
|
|
|
public render() {
|
2018-06-23 17:21:49 +00:00
|
|
|
const data = this.props.data;
|
2018-06-23 07:57:51 +00:00
|
|
|
return (
|
2018-06-23 17:32:35 +00:00
|
|
|
<ResponsiveContainer width="100%" height={200}>
|
2018-06-23 17:21:49 +00:00
|
|
|
<PieChart>
|
2018-06-23 17:32:35 +00:00
|
|
|
<Pie data={data} dataKey="age" cx={600} cy={100} outerRadius={80} fill="#82ca9d" />
|
2018-06-23 17:21:49 +00:00
|
|
|
<Tooltip />
|
|
|
|
|
</PieChart>
|
|
|
|
|
</ResponsiveContainer>
|
2018-06-23 07:57:51 +00:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|