Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaOlas committed May 22, 2024
1 parent 2e4f5e7 commit 9ce80fd
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/admin/dashboard-statistics/CountryStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import BarCharts from './charts/BarCharts';
import DashboardTable from './charts/DashboardTable';
import HorizontalBars from './charts/HorizontalCharts';
import HorizontalChart from './charts/HorizontalChart';
import PieCharts from './charts/PieCharts';
import PhaseDropdown from './filters/PhaseDropdown'
import styles from './styles/charts.module.css';
Expand All @@ -23,7 +23,7 @@ const CountryStats = () => {
<PhaseDropdown />
<h1>Statut: Observateur</h1>
<div className={styles.chartsContainer}>
<HorizontalBars />
<HorizontalChart />
<DashboardTable />
<div className={styles.engamentContainer}>
<PieCharts pieChartData={pieChartData} />
Expand Down
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>
);
}

0 comments on commit 9ce80fd

Please sign in to comment.