-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add chart "Taux de succès sur le nombre de coordinations de projets p…
…ar pilier"
- Loading branch information
Showing
8 changed files
with
209 additions
and
9 deletions.
There are no files selected for viewing
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
37 changes: 31 additions & 6 deletions
37
...cess-rate-for-amounts-by-pillar/index.tsx → ...ss-rate-and-evolution-by-pillar/index.tsx
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
76 changes: 76 additions & 0 deletions
76
...-types/charts/success-rate-and-evolution-by-pillar/options-coordination_number-values.tsx
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,76 @@ | ||
export default function Options(data) { | ||
console.log("data", data); | ||
|
||
if (!data) return null; | ||
|
||
// sort selectedCountry by action_id | ||
const selectedCountry = data.selectedCountry | ||
.filter((el) => el.ratio && el.ratio !== 0) | ||
.sort((a, b) => a.id - b.id); | ||
|
||
// sort otherCountries same as selectedCountry | ||
data.otherCountries.sort((a, b) => { | ||
return ( | ||
data.selectedCountry.findIndex((item) => item.id === a.id) - | ||
data.selectedCountry.findIndex((item) => item.id === b.id) | ||
); | ||
}); | ||
|
||
const otherCountriesSorted = selectedCountry.map((item) => { | ||
return data.otherCountries.find((otherItem) => otherItem.id === item.id); | ||
}); | ||
|
||
return { | ||
chart: { | ||
type: "column", | ||
height: 500, | ||
backgroundColor: "transparent", | ||
}, | ||
title: { text: "" }, | ||
legend: { enabled: false }, | ||
credits: { enabled: false }, | ||
|
||
xAxis: { | ||
categories: selectedCountry.map((item) => item.id), | ||
crosshair: true, | ||
accessibility: { | ||
description: "Actions", | ||
}, | ||
}, | ||
yAxis: { | ||
min: 0, | ||
title: { | ||
text: "(%)", | ||
}, | ||
}, | ||
tooltip: { | ||
valueSuffix: " (%)", | ||
}, | ||
plotOptions: { | ||
column: { | ||
pointPadding: 0.2, | ||
borderWidth: 0, | ||
}, | ||
}, | ||
series: [ | ||
{ | ||
name: "Pays", | ||
data: selectedCountry.map( | ||
(item) => | ||
(item.total_coordination_number_successful * 100) / | ||
item.total_coordination_number_evaluated | ||
), | ||
color: "#6DD897", | ||
}, | ||
{ | ||
name: "UE & Etats associés", | ||
data: otherCountriesSorted.map( | ||
(item) => | ||
(item.total_coordination_number_successful * 100) / | ||
item.total_coordination_number_evaluated | ||
), | ||
color: "#09622A", | ||
}, | ||
], | ||
}; | ||
} |
2 changes: 2 additions & 0 deletions
2
...ss-rate-for-amounts-by-pillar/options.tsx → ...on-by-pillar/options-subsidies-values.tsx
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
File renamed without changes.
File renamed without changes.
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