mirror of
https://git.roussel.pro/telecom-paris/pact.git
synced 2026-02-09 10:30:17 +01:00
35 lines
580 B
JavaScript
35 lines
580 B
JavaScript
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",
|
|
},
|
|
]
|
|
}}
|
|
/>
|
|
)
|
|
}
|