feat: PieChart data ploted from backend
parent
5e81f02116
commit
76929c41ec
|
@ -72,7 +72,7 @@ const PieChart = ({ data = dataExample }) => {
|
|||
return (
|
||||
<Box width="100%" height="100%" position="relative" display="flex">
|
||||
<Box sx={{ position: "absolute" }}>
|
||||
<Title>Tickets Status</Title>
|
||||
<Title>Tickets status de encerramento</Title>
|
||||
</Box>
|
||||
<Box
|
||||
component="ul"
|
||||
|
|
|
@ -258,7 +258,7 @@ const Dashboard = () => {
|
|||
const [usersOnlineInfo, dispatch] = useReducer(reducer, [])
|
||||
const [ticketStatusChange, setStatus] = useState()
|
||||
const [ticketsStatus, setTicktsStatus] = useState({ open: 0, openAll: 0, pending: 0, closed: 0 })
|
||||
|
||||
const [ticketStatusChatEnd, setTicketStatusChatEnd] = useState([])
|
||||
const { user } = useContext(AuthContext)
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -287,12 +287,17 @@ const Dashboard = () => {
|
|||
|
||||
const { data } = await api.get("/reports/user/services", {
|
||||
params: { userId: null, startDate: dateToday, endDate: dateToday },
|
||||
})
|
||||
|
||||
// console.log('data.data: ', data.usersProfile)
|
||||
})
|
||||
|
||||
dispatch({ type: "RESET" })
|
||||
dispatch({ type: "LOAD_QUERY", payload: data.usersProfile })
|
||||
|
||||
const { data: ticketStatusChatEndData } = await api.get("/reports/count/statusChatEnd", {
|
||||
params: { startDate: '2024-03-21', endDate: '2024-03-28' },
|
||||
})
|
||||
|
||||
setTicketStatusChatEnd(ticketStatusChatEndData.reportStatusChatEnd)
|
||||
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
|
@ -506,7 +511,7 @@ const Dashboard = () => {
|
|||
</Grid>
|
||||
<Grid item xs={12} sm={12} md={6} lg={6}>
|
||||
<Paper className={classes.fixedHeightPaper} variant="outlined">
|
||||
<PieChart data={[]} />
|
||||
<PieChart data={ticketStatusChatEnd} />
|
||||
</Paper>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
Loading…
Reference in New Issue