Skip to content

Commit

Permalink
#74
Browse files Browse the repository at this point in the history
  • Loading branch information
jerem1508 committed Dec 9, 2024
1 parent 2e10849 commit 538d3ad
Show file tree
Hide file tree
Showing 16 changed files with 166 additions and 8 deletions.
12 changes: 12 additions & 0 deletions client/src/components/cards/genders-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type CardProps = {
import "./style.scss";

export default function GendersCard({ currentYear, values }: CardProps) {
const rootStyles = getComputedStyle(document.documentElement);
const secteursOptions = {
chart: {
backgroundColor: "transparent",
Expand All @@ -27,6 +28,17 @@ export default function GendersCard({ currentYear, values }: CardProps) {
align: "center",
verticalAlign: "middle",
y: 60,
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontSize: "16px",
fontFamily: "Marianne, sans-serif",
},
},
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
tooltip: {
pointFormat: "{series.name}: <b>{point.percentage:.1f}%</b>",
Expand Down
12 changes: 12 additions & 0 deletions client/src/components/cards/sectors-card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type CardProps = {
import "./style.scss";

export default function SectorsCard({ currentYear, values }: CardProps) {
const rootStyles = getComputedStyle(document.documentElement);
const secteursOptions = {
chart: {
backgroundColor: "transparent",
Expand All @@ -27,6 +28,17 @@ export default function SectorsCard({ currentYear, values }: CardProps) {
align: "center",
verticalAlign: "middle",
y: 60,
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontSize: "16px",
fontFamily: "Marianne, sans-serif",
},
},
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
tooltip: {
pointFormat: "{series.name}: <b>{point.percentage:.1f}%</b>",
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/cards/students-card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Row, Col, Badge } from "@dataesr/dsfr-plus";
import { Row, Col, Badge, Title } from "@dataesr/dsfr-plus";

import "./style.scss";

Expand Down Expand Up @@ -36,7 +36,7 @@ export default function StudentsCard({
)}
</Row>
<p className="fr-card__desc card-description">{descriptionNode}</p>
<h3 className="fr-card__title">
<Title as="h3" className="fr-card__title">
{to !== "#" ? (
<a href={to} className="fr-card__link">
<div className="key-number">
Expand Down Expand Up @@ -68,7 +68,7 @@ export default function StudentsCard({
)}
</>
)}
</h3>
</Title>
</div>
</div>
</div>
Expand Down
2 changes: 0 additions & 2 deletions client/src/components/cards/students-card/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.students-card {
.key-number {
color: #222;
font-size: 2.5rem;
font-style: normal;
font-weight: 500;
Expand All @@ -11,7 +10,6 @@
.students-label {
font-size: 0.9rem;
font-weight: 700;
color: #222;
display: inline-block;
padding: 0;
padding-bottom: 10px;
Expand Down
21 changes: 21 additions & 0 deletions client/src/pages/atlas/charts/filieres-genders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,30 @@ export default function FilieresGendersChart({
if (isLoading) {
return <Template />;
}
const rootStyles = getComputedStyle(document.documentElement);
const filieresOptions = {
chart: {
backgroundColor: "transparent",
type: "bar",
height: "600",
},
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
title: {
text: "",
},
xAxis: {
categories: data.map((filiere) => filiere.label),
labels: {
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
title: {
text: "",
},
Expand All @@ -41,9 +54,17 @@ export default function FilieresGendersChart({
title: {
text: "Nombre d'étudiants",
align: "high",
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
labels: {
overflow: "justify",
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
gridLineWidth: 0,
},
Expand Down
21 changes: 21 additions & 0 deletions client/src/pages/atlas/charts/filieres-sectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ export default function FilieresSectorsChart({
if (isLoading) {
return <Template />;
}
const rootStyles = getComputedStyle(document.documentElement);
const filieresOptions = {
chart: {
backgroundColor: "transparent",
type: "bar",
height: "600",
},
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
title: {
text: "",
},
Expand All @@ -35,15 +42,29 @@ export default function FilieresSectorsChart({
},
gridLineWidth: 0.5,
lineWidth: 0,
labels: {
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
},
yAxis: {
min: 0,
title: {
text: "Nombre d'étudiants",
align: "high",
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
labels: {
overflow: "justify",
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
gridLineWidth: 0,
},
Expand Down
24 changes: 24 additions & 0 deletions client/src/pages/atlas/charts/genders-histo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export default function GendersHistoChart({
break;
}

const rootStyles = getComputedStyle(document.documentElement);

const options = {
chart: {
type,
Expand All @@ -79,21 +81,43 @@ export default function GendersHistoChart({
},
backgroundColor: "transparent",
},
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
title: { text: "" },
credits: {
enabled: false,
},
xAxis: {
categories: data.map((item) => item.annee_universitaire),
labels: {
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
},
yAxis: {
min: 0,
title: {
text: "Nombre d'étudiants",
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
stackLabels: {
enabled: true,
},
labels: {
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
},
tooltip: {
headerFormat: "<b>{point.x}</b><br/>",
Expand Down
7 changes: 7 additions & 0 deletions client/src/pages/atlas/charts/genders-pie/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ export default function GenderChart({
if (isLoading || !data || !data.length) {
return <div>Loader</div>;
}
const rootStyles = getComputedStyle(document.documentElement);
const secteursOptions = {
chart: {
type: "pie",
height: "60%",
backgroundColor: "transparent",
},
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
title: {
text: "",
},
Expand Down
7 changes: 7 additions & 0 deletions client/src/pages/atlas/charts/map-pie-genders/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,16 @@ export default function MapPieGenders({
const b = -a * minStaff;

// Build the chart
const rootStyles = getComputedStyle(document.documentElement);
const options = {
title: { text: "" },
credits: { enabled: false },
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
chart: {
animation: false,
backgroundColor: "transparent",
Expand Down
7 changes: 7 additions & 0 deletions client/src/pages/atlas/charts/map-pie-sectors/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,16 @@ export default function MapPieSectors({
const b = -a * minStaff;

// Build the chart
const rootStyles = getComputedStyle(document.documentElement);
const options = {
title: { text: "" },
credits: { enabled: false },
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
chart: {
animation: false,
backgroundColor: "transparent",
Expand Down
24 changes: 24 additions & 0 deletions client/src/pages/atlas/charts/sectors-histo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export default function SectorsHistoChart({
break;
}

const rootStyles = getComputedStyle(document.documentElement);

const options = {
chart: {
type,
Expand All @@ -77,6 +79,12 @@ export default function SectorsHistoChart({
},
backgroundColor: "transparent",
},
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
title: {
text: "",
},
Expand All @@ -85,15 +93,31 @@ export default function SectorsHistoChart({
},
xAxis: {
categories: data.map((item) => item.annee_universitaire),
labels: {
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
},
yAxis: {
min: 0,
title: {
text: "Nombre d'étudiants",
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
stackLabels: {
enabled: true,
},
labels: {
style: {
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
},
},
},
tooltip: {
headerFormat: "<b>{point.x}</b><br/>",
Expand Down
7 changes: 7 additions & 0 deletions client/src/pages/atlas/charts/sectors-pie/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function SectortsChart({
if (isLoading || !data || !data.length) {
return <div>Loader</div>;
}
const rootStyles = getComputedStyle(document.documentElement);
const secteursOptions = {
chart: {
type: "pie",
Expand All @@ -28,6 +29,12 @@ export default function SectortsChart({
credits: {
enabled: false,
},
legend: {
itemStyle:{
color: rootStyles.getPropertyValue("--label-color"),
fontFamily: "Marianne, sans-serif",
}
},
plotOptions: {
series: {
allowPointSelect: true,
Expand Down
Loading

0 comments on commit 538d3ad

Please sign in to comment.