mirror of
https://git.roussel.pro/telecom-paris/pact.git
synced 2026-02-09 10:30:17 +01:00
Interface admin : graph page d'accueil
This commit is contained in:
47
code/interface_admin/components/ComparativeBarChart.jsx
Normal file
47
code/interface_admin/components/ComparativeBarChart.jsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import React from 'react'
|
||||
import { Bar } from 'react-chartjs-2'
|
||||
import Chart from 'chart.js/auto';
|
||||
|
||||
export default function ComparativeBarChart({ xlabels, data0, label0, data1, label1, title }) {
|
||||
return (
|
||||
<Bar
|
||||
options={{
|
||||
plugins: {
|
||||
title: {
|
||||
display: true,
|
||||
text: title
|
||||
},
|
||||
},
|
||||
responsive: true,
|
||||
interaction: {
|
||||
intersect: false,
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
stacked: true,
|
||||
},
|
||||
y: {
|
||||
stacked: true
|
||||
}
|
||||
}
|
||||
}}
|
||||
data={{
|
||||
labels: xlabels,
|
||||
datasets: [
|
||||
{
|
||||
label: label0,
|
||||
data: data0,
|
||||
backgroundColor: "#FF3B30",
|
||||
stack: "stack0"
|
||||
},
|
||||
{
|
||||
label: label1,
|
||||
data: data1,
|
||||
backgroundColor: "#0000FF",
|
||||
stack: "stack1"
|
||||
}
|
||||
]
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
23
code/interface_admin/components/Menu.jsx
Normal file
23
code/interface_admin/components/Menu.jsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import React from 'react'
|
||||
import Link from 'next/link'
|
||||
import Container from 'react-bootstrap/Container';
|
||||
import Nav from 'react-bootstrap/Nav';
|
||||
import Navbar from 'react-bootstrap/Navbar';
|
||||
|
||||
export default function Menu() {
|
||||
return (
|
||||
<Navbar bg="light" expand="lg">
|
||||
<Container>
|
||||
<Navbar.Brand href="#home">Téléreview</Navbar.Brand>
|
||||
<Navbar.Toggle aria-controls="basic-navbar-nav" />
|
||||
<Navbar.Collapse id="basic-navbar-nav">
|
||||
<Nav className="me-auto">
|
||||
<Link href="/" passHref legacyBehavior><Nav.Link>Accueil</Nav.Link></Link>
|
||||
<Link href="/stats" passHref legacyBehavior><Nav.Link>Statistiques</Nav.Link></Link>
|
||||
<Link href="/avis" passHref legacyBehavior><Nav.Link>Avis</Nav.Link></Link>
|
||||
</Nav>
|
||||
</Navbar.Collapse>
|
||||
</Container>
|
||||
</Navbar>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user