-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e4f5e7
commit 9ce80fd
Showing
2 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/components/admin/dashboard-statistics/charts/HorizontalChart.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { BarChart } from '@mui/x-charts/BarChart'; | ||
import * as React from 'react'; | ||
|
||
import styles from '../styles/charts.module.css'; | ||
import { useGetClassroomExchanges, ClassroomExchangesStats } from 'src/api/statistics/statistics.get.ts'; | ||
|
||
const chartSetting = { | ||
xAxis: [ | ||
{ | ||
label: 'publications & commentaires', | ||
}, | ||
], | ||
width: 500, | ||
height: 400, | ||
}; | ||
const dataset = []; | ||
|
||
const valueFormatter = (value: number | null) => `${value}mm`; | ||
|
||
// eslint-disable-next-line no-console | ||
console.log('Data:', data); | ||
|
||
// handle loading & errors | ||
// if (isLoading) return <div>Loading...</div>; | ||
// if (isError) return <div>Error...</div>; | ||
|
||
export default function HorizontalBars() { | ||
return ( | ||
<div className={styles.horizontalBars}> | ||
<BarChart | ||
dataset={dataset} | ||
yAxis={[ | ||
{ | ||
scaleType: 'band', | ||
dataKey: 'month', | ||
}, | ||
]} | ||
series={[{ dataKey: 'seoul', valueFormatter, color: '#4C3ED9' }]} | ||
layout="horizontal" | ||
{...chartSetting} | ||
slotProps={{ | ||
bar: { | ||
clipPath: `inset(0px round 25px)`, | ||
}, | ||
}} | ||
/> | ||
</div> | ||
); | ||
} |