Last active
January 6, 2022 03:18
-
-
Save eggei/81c7cc4d55db9e87ebd4c88a2ba89fcb to your computer and use it in GitHub Desktop.
recharts-simple-line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type data = Array<{ | |
name: string | |
uv: number | |
pv: number | |
amt: number | |
}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LineChart | |
width={500} | |
height={300} | |
data={data} | |
margin={{ | |
top: 5, right: 30, left: 20, bottom: 5, | |
}} | |
> | |
<CartesianGrid strokeDasharray="3 3" /> | |
<XAxis dataKey="name" /> | |
<YAxis /> | |
<Tooltip /> | |
<Legend /> | |
<Line type="monotone" dataKey="pv" stroke="#8884d8" activeDot={{ r: 8 }} /> | |
<Line type="monotone" dataKey="uv" stroke="#82ca9d" /> | |
</LineChart> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment