Skip to content

Instantly share code, notes, and snippets.

@indreklasn
Last active September 7, 2020 13:36
Show Gist options
  • Save indreklasn/4d626e45dc53f9a169b2c5020cf833e4 to your computer and use it in GitHub Desktop.
Save indreklasn/4d626e45dc53f9a169b2c5020cf833e4 to your computer and use it in GitHub Desktop.
import React from 'react';
import {
LineChart, Line, XAxis, CartesianGrid, Tooltip,
} from 'recharts';
const Recharts = () => (
<LineChart
width={400}
height={400}
data={data}
margin={{ top: 5, right: 20, left: 10, bottom: 5 }}
>
<XAxis dataKey="name" />
<Tooltip />
<CartesianGrid stroke="#f5f5f5" />
<Line type="monotone" dataKey="uv" stroke="#ff7300" yAxisId={0} />
<Line type="monotone" dataKey="pv" stroke="#387908" yAxisId={1} />
</LineChart>
)
export default Recharts;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment