1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| import { LineChart, Line, XAxis, YAxis, Tooltip } from 'recharts'; function RenderLineChart() { const data = [ { name: 'Page A', uv: 400, pv: 2400, amt: 2400 }, { name: 'Page B', uv: 800, pv: 1200, amt: 2400 }, { name: 'Page C', uv: 900, pv: 3000, amt: 2400 }, ]; return ( <LineChart width={400} height={250} data={data}> <XAxis dataKey="name" /> <YAxis /> <Tooltip /> <Line type="monotone" dataKey="uv" stroke="#8884d8" /> <Line type="monotone" dataKey="pv" stroke="#3f51b5" /> <Line type="monotone" dataKey="amt" stroke="#666666" /> </LineChart> ); }
//在對應要放入的位置放入 <RenderLineChart />
|