"
var div_menu_n4v = "";
var content_data = {
title: "Vue des données",
width: 362.4000000000824,
height: 301.6000000000686,
pagination: "",
duration: 800,
container: "#container",
headers: ["d1|Année","d2|LIB_FAP2","m1|Part difficiles",],
locale: "fr",
mes_fmt: {"Part difficiles":{"title":"Part de projets difficiles","precision":"0","unit":"%","unitsuf":true}},
thousand: " ",
decimal: ".",
data: [{d1:"2022",d2:"Agents d'entretien",m1:59.2265605570754},{d1:"2023",d2:"Agents d'entretien",m1:49.1809963099631},{d1:"2022",d2:"Conducteurs de véhicules",m1:72.5715094873973},{d1:"2023",d2:"Conducteurs de véhicules",m1:67.2592259847961},{d1:"2022",d2:"Cuisiniers",m1:67.079637711765},{d1:"2023",d2:"Cuisiniers",m1:64.158895949166},{d1:"2022",d2:"Employés et agents de maîtrise de l'hôtellerie et de la restauration",m1:67.2000636891967},{d1:"2023",d2:"Employés et agents de maîtrise de l'hôtellerie et de la restauration",m1:65.5984522461306},{d1:"2022",d2:"Ouvriers non qualifiés des industries de process",m1:59.1267434808975},{d1:"2023",d2:"Ouvriers non qualifiés des industries de process",m1:62.57488},{d1:"2022",d2:"Ouvriers qualifiés de la manutention",m1:54.9568221070812},{d1:"2023",d2:"Ouvriers qualifiés de la manutention",m1:57.0574468085106},{d1:"2022",d2:"Secrétaires",m1:40.7757980697847},{d1:"2023",d2:"Secrétaires",m1:47},{d1:"2022",d2:"Techniciens et agents de maîtrise de la maintenance",m1:72.4841101694915},{d1:"2023",d2:"Techniciens et agents de maîtrise de la maintenance",m1:76.3135964912281},{d1:"2022",d2:"Vendeurs",m1:47.4113066051341},{d1:"2023",d2:"Vendeurs",m1:47.3414296134209},]
};
function UpdateFSIcon(){
var titfs_href = document.getElementById("fshref_n4v");
document.addEventListener("fullscreenchange", function( event ) {
if ( !document.fullscreen ){
document.getElementById("n4v_fs_button").style.backgroundImage="url(https://graphebo.via-competences.fr/N4VCustomElements/res/css/images/n4v_fullscreen.svg)";
titfs_href.title= "Vue plein écran";
}
else {
document.getElementById("n4v_fs_button").style.backgroundImage="url(https://graphebo.via-competences.fr/N4VCustomElements/res/css/images/n4v_minscreen.svg)";
titfs_href.title= "Quitter plein écran";
}
});
}
//setWebiLinked(document);
$(function () {
Dessin_graph();
});
function Dessin_graph(){
var per_init = 0;
var mydata = [];
var flags=[];
var periodes=['2022','2023',];
mydata["2022"] = [["Conducteurs de véhicules",72.5715094873973],["Techniciens et agents de maîtrise de la maintenance",72.4841101694915],["Employés et agents de maîtrise de l'hôtellerie et de la restauration",67.2000636891967],["Cuisiniers",67.079637711765],["Agents d'entretien",59.2265605570754],["Ouvriers non qualifiés des industries de process",59.1267434808975],["Ouvriers qualifiés de la manutention",54.9568221070812],["Vendeurs",47.4113066051341],["Secrétaires",40.7757980697847],["Ouvriers qualifiés du second œuvre du bâtiment",0],];
mydata["2023"] = [["Techniciens et agents de maîtrise de la maintenance",76.3135964912281],["Conducteurs de véhicules",67.2592259847961],["Employés et agents de maîtrise de l'hôtellerie et de la restauration",65.5984522461306],["Cuisiniers",64.158895949166],["Ouvriers non qualifiés des industries de process",62.57488],["Ouvriers qualifiés de la manutention",57.0574468085106],["Agents d'entretien",49.1809963099631],["Vendeurs",47.3414296134209],["Secrétaires",47],["Ouvriers qualifiés du second œuvre du bâtiment",0],];
var icons=[];
function getData(period) {
var initialData = mydata[period];
let output = initialData.map( (x) => x);
return output;
}
Highcharts.AST.allowedReferences.push("javascript:");
Highcharts.setOptions({
lang: {
thousandsSep: " ",
decimalPoint: ".",
},
colors : ["#491547","#985092","#D1BCDC","#005E5E","#00A6A5","#B2DDDF","#FCD12D","#F9B524",]
});
var chart = Highcharts.chart("container", {
chart: {
animation: {duration: 1900},
marginRight: 50,
backgroundColor: "#ffffff",
},
title: {
text: "",
style:{ color: "#000000",
fontFamily: "Arial",
fontSize: "12px",
fontWeight: "normal",
textDecoration: "plain",
fontStyle: "normal" },
align: "center"
},
subtitle: {
text: "",
style:{ color: "#848284",
fontFamily: "Arial",
fontSize: "10px",
fontWeight: "normal",
textDecoration: "plain",
fontStyle: "normal" },
align: "center"
},
xAxis: {
type: "category",
gridLineWidth: 0,
gridLineColor : "#e6e6e6",
lineWidth: 1,
lineColor : "#e6e6e6",
max: 9,
title: {text:"",
useHTML: true,
style:{ color: "#848284",
fontFamily: "Arial",
fontSize: "12px",
fontWeight: "normal",
textDecoration: "plain",
fontStyle: "normal" }
},
labels: {
useHTML: true,
animate: true,
enabled : true,
rotation: 0,
formatter: ctx => {
return ctx.value; },
style: {
textAlign: "center"
},
style: {color: "#848284",
fontFamily: "Arial",
fontSize: "12px",
fontWeight: "normal",
textDecoration: "plain",
fontStyle: "normal" }
}
},
yAxis: {
labels: {
rotation: 0,
style: {color: "#848284",
fontFamily: "Arial",
fontSize: "12px",
fontWeight: "normal",
fontStyle: "normal" },
enabled : true
},
opposite: false,
endOnTick: true,
gridLineWidth: 1,
gridLineColor : "#e6e6e6",
lineWidth: 1,
lineColor : "#e6e6e6",
title: {text:"",
useHTML: true,
style:{ color: "#848284",
fontFamily: "Arial",
fontSize: "12px",
fontWeight: "normal",
textDecoration: "plain",
fontStyle: "normal" }
},
},
tooltip: {
headerFormat: '{series.name}
',
pointFormat: '
{point.name}
\u25CF Part de projets difficiles : {point.y}
',
valueDecimals: 0,
valuePrefix: '',
valueSuffix: '%'
},
legend: {
align: "right",
verticalAlign: "bottom",
itemStyle: {color: "#848284",
fontFamily: "Arial",
fontWeight: "bold",
fontSize: "13px",
textDecoration: "plain",
fontStyle: "normal"
},
symbolHeight: 0.001,
symbolWidth: 0.001,
symbolRadius: 0.001,
},
plotOptions: {
series: {
animation: false,
events: {
legendItemClick: function(e) {
e.preventDefault();
}
},
groupPadding: 0,
pointPadding: 0.1,
borderWidth: 0,
borderRadius: 0,
},
},
series: [{
colorByPoint: true,
dataSorting: {
enabled: true,
matchByName: true
},
type: "bar",
dataLabels: [{
enabled: true,
inside: false,
useHTML: true,
formatter: function () {
return ""+Highcharts.numberFormat(this.point.y,0,"."," ")+"%"; },
style:{ color: "#848284",
fontFamily: "Arial",
fontSize: "11px",
fontWeight: "normal",
textDecoration: "plain",
textOutline: "1px contrast",
fontStyle: "normal" }
}],
name: periodes[0],
data: getData(periodes[0])
}],
});
$("#container").append(div_menu_btn);
const btn = document.getElementById("play-pause-button"),
btn_stop = document.getElementById("stop-button"),
bubble = document.getElementById("bubble"),
input = document.getElementById("play-range");
function update(increment) {
bubble.style.display = "none";
if(increment == 0){
per_init=0;
pause(btn);
input.value=0;
}else if(increment == 1){
per_init++
if (per_init < periodes.length){
input.value = per_init;
}else{
update(0);
play(btn);
}
}
else{
per_init = input.value;
}
if (per_init < periodes.length){
chart.series[0].update({
name: periodes[per_init],
data: getData(periodes[per_init])
});
}
}
function play(button) {
button.title = "pause";
button.className = "pause_button";
chart.sequenceTimer = setInterval(function() {
update(1);
}, 2000);
}
function pause(button) {
button.title = "play";
button.className = "play_button";
clearTimeout(chart.sequenceTimer);
chart.sequenceTimer = undefined;
}
var el, newPoint, newPlace, offset;
$("input[type=range]").on("input", function () {
$(this).trigger("change");
});
$("input[type=range]").change(function() {
bubble.style.display = "inline-block";
el = $(this);
width = el.width();
newPoint = (el.val() - el.attr("min")) / (el.attr("max") - el.attr("min"));
offset = -1;
if (newPoint < 0) { newPlace = 0; }
else if (newPoint > 1) { newPlace = width; }
else { newPlace = width * newPoint + offset; offset -= newPoint; }
el
.next("output")
.css({
left: newPlace,
marginLeft: offset + "%"
})
.text(periodes[el.val()]);
})
btn.addEventListener("click", function() {
if (chart.sequenceTimer) {
pause(this)
} else {
play(this)
}
})
btn_stop.addEventListener("click", function() {
update(0);
})
input.addEventListener("click", function() {
pause(btn);
update(2)
})
$("#container").append(div_menu_n4v);
UpdateFSIcon();
play(btn);
}