first commit
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import { PieChart, Pie, Sector, Cell, ResponsiveContainer } from "recharts";
|
||||
|
||||
const data01 = [
|
||||
{ name: "Group A", value: 400 },
|
||||
{ name: "Group B", value: 300 },
|
||||
{ name: "Group C", value: 300 },
|
||||
{ name: "Group D", value: 200 },
|
||||
];
|
||||
const data02 = [
|
||||
{ name: "A1", value: 100 },
|
||||
{ name: "A2", value: 300 },
|
||||
{ name: "B1", value: 100 },
|
||||
{ name: "B2", value: 80 },
|
||||
{ name: "B3", value: 40 },
|
||||
{ name: "B4", value: 30 },
|
||||
{ name: "B5", value: 50 },
|
||||
{ name: "C1", value: 100 },
|
||||
{ name: "C2", value: 200 },
|
||||
{ name: "D1", value: 150 },
|
||||
{ name: "D2", value: 50 },
|
||||
];
|
||||
|
||||
const TwoLevelPieChart = () => {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
borderBottom: "1px solid #EEF0F7",
|
||||
paddingBottom: "5px",
|
||||
mb: "15px",
|
||||
}}
|
||||
className="for-dark-bottom-border"
|
||||
>
|
||||
Two Level Pie Chart
|
||||
</Typography>
|
||||
|
||||
<ResponsiveContainer width="100%" aspect={2.0 / 0.9}>
|
||||
<PieChart width={400} height={400}>
|
||||
<Pie
|
||||
data={data01}
|
||||
dataKey="value"
|
||||
cx="50%"
|
||||
cy="50%"
|
||||
outerRadius={60}
|
||||
fill="#8884d8"
|
||||
/>
|
||||
<Pie
|
||||
data={data02}
|
||||
dataKey="value"
|
||||
cx="50%"
|
||||
cy="50%"
|
||||
innerRadius={70}
|
||||
outerRadius={90}
|
||||
fill="#82ca9d"
|
||||
label
|
||||
/>
|
||||
</PieChart>
|
||||
</ResponsiveContainer>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default TwoLevelPieChart;
|
||||
Reference in New Issue
Block a user