mirror of
https://git.roussel.pro/telecom-paris/pact.git
synced 2026-02-09 10:30:17 +01:00
page stats fonctionelle et connectée a la bdd
This commit is contained in:
@@ -1,17 +1,11 @@
|
||||
import React from 'react'
|
||||
import { Bar } from 'react-chartjs-2'
|
||||
import Chart from 'chart.js/auto';
|
||||
import Chart from 'chart.js/auto'; //NE SURTOUT PAS SUPPRIMER CET IMPORT
|
||||
|
||||
export default function ComparativeBarChart({ xlabels, data0, label0, data1, label1}) {
|
||||
return (
|
||||
<Bar
|
||||
options={{
|
||||
// plugins: {
|
||||
// title: {
|
||||
// display: true,
|
||||
// text: title
|
||||
// },
|
||||
// },
|
||||
responsive: true,
|
||||
interaction: {
|
||||
intersect: false,
|
||||
|
||||
34
code/interface_admin/components/StatBarChart.jsx
Normal file
34
code/interface_admin/components/StatBarChart.jsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import React, { useRef } from 'react'
|
||||
import { Bar } from 'react-chartjs-2'
|
||||
import Chart from 'chart.js/auto'; //NE SURTOUT PAS SUPPRIMER CET IMPORT
|
||||
|
||||
export default function StatBarChart({labels, data}) {
|
||||
return (
|
||||
<Bar
|
||||
options={{
|
||||
redraw: true,
|
||||
responsive: true,
|
||||
interaction: {
|
||||
intersect: false,
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
stacked: true,
|
||||
},
|
||||
y: {
|
||||
stacked: true
|
||||
}
|
||||
}
|
||||
}}
|
||||
data={{
|
||||
labels: labels,
|
||||
datasets: [
|
||||
{
|
||||
data: data,
|
||||
backgroundColor: "#FF3B30",
|
||||
},
|
||||
]
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user