first commit
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import {
|
||||
ComposedChart,
|
||||
Line,
|
||||
Area,
|
||||
Bar,
|
||||
XAxis,
|
||||
YAxis,
|
||||
CartesianGrid,
|
||||
Tooltip,
|
||||
Legend,
|
||||
ResponsiveContainer,
|
||||
} from 'recharts';
|
||||
|
||||
const data = [
|
||||
{
|
||||
name: 'Page A',
|
||||
uv: 590,
|
||||
pv: 800,
|
||||
amt: 1400,
|
||||
},
|
||||
{
|
||||
name: 'Page B',
|
||||
uv: 868,
|
||||
pv: 967,
|
||||
amt: 1506,
|
||||
},
|
||||
{
|
||||
name: 'Page C',
|
||||
uv: 1397,
|
||||
pv: 1098,
|
||||
amt: 989,
|
||||
},
|
||||
{
|
||||
name: 'Page D',
|
||||
uv: 1480,
|
||||
pv: 1200,
|
||||
amt: 1228,
|
||||
},
|
||||
{
|
||||
name: 'Page E',
|
||||
uv: 1520,
|
||||
pv: 1108,
|
||||
amt: 1100,
|
||||
},
|
||||
{
|
||||
name: 'Page F',
|
||||
uv: 1400,
|
||||
pv: 680,
|
||||
amt: 1700,
|
||||
},
|
||||
];
|
||||
|
||||
const SameDataComposedChart = () => {
|
||||
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"
|
||||
>
|
||||
Same Data Composed Chart
|
||||
</Typography>
|
||||
|
||||
<ResponsiveContainer width="100%" aspect={2.0 / 0.9}>
|
||||
<ComposedChart
|
||||
width={500}
|
||||
height={400}
|
||||
data={data}
|
||||
margin={{
|
||||
top: 20,
|
||||
right: 20,
|
||||
bottom: 20,
|
||||
left: 20,
|
||||
}}
|
||||
>
|
||||
<CartesianGrid stroke="#f5f5f5" />
|
||||
<XAxis dataKey="name" scale="band" />
|
||||
<YAxis />
|
||||
<Tooltip />
|
||||
<Legend />
|
||||
<Bar dataKey="uv" barSize={20} fill="#413ea0" />
|
||||
<Line type="monotone" dataKey="uv" stroke="#ff7300" />
|
||||
</ComposedChart>
|
||||
</ResponsiveContainer>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SameDataComposedChart;
|
||||
Reference in New Issue
Block a user