update data.js

master
mahdi andalib 3 years ago
parent be6a3a8dc0
commit e7e6d8d8ce
  1. 32
      src/components/Recharts/index.js
  2. 11
      src/redux/data.js

@ -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 },
],
};

@ -8,6 +8,7 @@ import Toast from "../components/Toast";
import Banners from "../components/Banners"; import Banners from "../components/Banners";
import Blogss from "../components/Blogss"; import Blogss from "../components/Blogss";
import CardTrelloDesign from "../components/CardTrelloDesign"; import CardTrelloDesign from "../components/CardTrelloDesign";
import Chart from "../components/Recharts";
// mini components // mini components
import MiniComponents from "../components/MiniComponents"; import MiniComponents from "../components/MiniComponents";
@ -202,6 +203,16 @@ const components = [
code: null, code: null,
}, },
}, },
{
name: "Chart",
author: "Ashrafi",
props: [],
content: {
name: "Chart",
component: <Chart />,
code: null,
},
},
// mini components // mini components
{ {
name: "Mini Components", name: "Mini Components",

Loading…
Cancel
Save