parent
be6a3a8dc0
commit
e7e6d8d8ce
2 changed files with 43 additions and 0 deletions
@ -0,0 +1,32 @@ |
||||
import React from "react"; |
||||
import { LineChart, XAxis, Tooltip, CartesianGrid, Line } from "recharts"; |
||||
|
||||
function Recharts({ data }) { |
||||
return ( |
||||
<LineChart |
||||
width={400} |
||||
height={400} |
||||
data={data} |
||||
margin={{ top: 5, right: 20, left: 10, bottom: 5 }} |
||||
> |
||||
<XAxis dataKey="name" /> |
||||
<Tooltip /> |
||||
<CartesianGrid stroke="#ddd" /> |
||||
{/* <Line type="monotone" dataKey="uv" stroke="#ff7300" yAxisId={0} /> */} |
||||
<Line type="monotone" dataKey="pv" stroke="#387908" yAxisId={1} /> |
||||
</LineChart> |
||||
); |
||||
} |
||||
|
||||
export default Recharts; |
||||
|
||||
Recharts.defaultProps = { |
||||
data: [ |
||||
{ name: "", uv: 400, pv: 100, amt: 600 }, |
||||
{ name: "", uv: 400, pv: 200, amt: 500 }, |
||||
{ name: "", uv: 400, pv: 300, amt: 400 }, |
||||
{ name: "", uv: 400, pv: 400, amt: 300 }, |
||||
{ name: "", uv: 400, pv: 500, amt: 200 }, |
||||
{ name: "", uv: 400, pv: 600, amt: 100 }, |
||||
], |
||||
}; |
Loading…
Reference in new issue