dashboard implemented

dev
Aji Kamaludin 3 years ago
parent 85d66d8cb3
commit cbc909aef1
No known key found for this signature in database
GPG Key ID: 670E1F26AD5A8099

@ -0,0 +1,17 @@
import axios from 'axios';
export function getSummary(token) {
return axios({
method: 'GET',
url: `/dashboard`,
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((res) => {
return res.data;
})
.catch((err) => {
throw err.response;
});
}

@ -102,7 +102,7 @@ export default function Dashboard(props) {
)} )}
</Flex> </Flex>
<Flex mt="3" direction={{ base: 'column', md: 'row' }}> <Flex mt="3" direction={{ base: 'column', md: 'row' }}>
<Card flex="1" mx="1" my="1"> <Card flex="1" mx="1" my="1" maxW="30rem">
<LineChart width={400} height={300} data={graphSale}> <LineChart width={400} height={300} data={graphSale}>
<Line type="monotone" dataKey="sale" stroke="#8884d8" /> <Line type="monotone" dataKey="sale" stroke="#8884d8" />
<CartesianGrid stroke="#ccc" /> <CartesianGrid stroke="#ccc" />
@ -112,7 +112,7 @@ export default function Dashboard(props) {
<YAxis dataKey="sale" interval="preserveEnd" /> <YAxis dataKey="sale" interval="preserveEnd" />
</LineChart> </LineChart>
</Card> </Card>
<Card flex="1" mx="1" my="1"> <Card flex="1" mx="1" my="1" maxW="30rem">
<LineChart width={400} height={300} data={graphPurchase}> <LineChart width={400} height={300} data={graphPurchase}>
<Line type="monotone" dataKey="purchase" stroke="#8884d8" /> <Line type="monotone" dataKey="purchase" stroke="#8884d8" />
<CartesianGrid stroke="#ccc" /> <CartesianGrid stroke="#ccc" />

Loading…
Cancel
Save