Please follow the steps:
1.Navigation to the list as a site admin
2.Create the below Choice columns in the list
- [Etat du projet]
- [Etat du budget]
- [Etat du planning]
- [Etat du perimetre]
3.Use the below JSON formatting for each Choice column
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"children": [
{
"elmType": "img",
"style": {
"position": "relative",
"top ": "50%",
"left": "50%",
"width": "48px",
"height": "auto",
"margin-left": "-50%",
"margin-top": "0%"
},
"attributes": {
"src": "=if(@currentField == 'Beau', 'https://xxxx.sharepoint.com/sites/echodu/SiteAssets/icon/sun.jpg', if(@currentField == 'Orageux', 'https://xxxx.sharepoint.com/sites/echodu/SiteAssets/icon/thunderstorm.jpg', if(@currentField == 'Pluvieux', 'https://xxxx.sharepoint.com/sites/echodu/SiteAssets/icon/rain.jpg', if(@currentField == 'Gel', 'https://xxxx.sharepoint.com/sites/echodu/SiteAssets/icon/snow.jpg',if(@currentField == 'Nuageux','https://xxxx.sharepoint.com/sites/echodu/SiteAssets/icon/cloud.jpg','https://xxxx.sharepoint.com/sites/echodu/SiteAssets/icon/na.jpg')))))"
}
}
]
}
Note:
- You have to upload your images to Site Assets library(or
somewhere else on your site) and replace the image URL with your own.