Skip to content

Instantly share code, notes, and snippets.

@eggei
Last active January 6, 2022 03:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eggei/81c7cc4d55db9e87ebd4c88a2ba89fcb to your computer and use it in GitHub Desktop.
Save eggei/81c7cc4d55db9e87ebd4c88a2ba89fcb to your computer and use it in GitHub Desktop.
recharts-simple-line
type data = Array<{
name: string
uv: number
pv: number
amt: number
}>
<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