-
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.
Add chart.js and react-chartjs-2 for displaying absence information
- Loading branch information
1 parent
6280f3f
commit 31a50ad
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,44 @@ | ||
import { | ||
Chart as ChartJS, | ||
CategoryScale, | ||
LinearScale, | ||
PointElement, | ||
LineElement, | ||
Title, | ||
Tooltip, | ||
Legend, | ||
} from "chart.js"; | ||
import { Line } from "react-chartjs-2"; | ||
|
||
ChartJS.register( | ||
CategoryScale, | ||
LinearScale, | ||
PointElement, | ||
LineElement, | ||
Title, | ||
Tooltip, | ||
Legend | ||
); | ||
|
||
export default function AbsenceInfo() { | ||
const data = { | ||
labels: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], | ||
datasets: [ | ||
{ | ||
label: "تغير نسبة الغياب", | ||
data: [90, 89, 88, 87, 100, 85, 84, 60, 82, 81, 66, 70, 77, 40], | ||
borderColor: "rgb(75, 192, 192)", | ||
fill: false, | ||
cubicInterpolationMode: "monotone", | ||
tension: 0.4, | ||
}, | ||
], | ||
}; | ||
|
||
return ( | ||
<div className="absence-info"> | ||
<h4>الغياب</h4> | ||
<Line data={data} /> | ||
</div> | ||
); | ||
} |
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