"
var div_menu_n4v = "";
var content_data = {
title: "Vue des données",
width: 362.4000000000824,
height: 392.8000000000893,
pagination: "",
duration: 800,
container: "#container",
headers: ["d1|num_an","d2|Libellé FAP1","m1|Effectifs_arr",],
locale: "fr",
mes_fmt: {"Effectifs_arr":{"title":"Nb d\\'actifs","precision":"0","unit":""}},
thousand: " ",
decimal: ".",
data: [{d1:"2008",d2:"Administration publique, professions juridiques, armée et police",m1:253860},{d1:"2019",d2:"Administration publique, professions juridiques, armée et police",m1:255360},{d1:"2008",d2:"Agriculture, marine, pêche",m1:97920},{d1:"2019",d2:"Agriculture, marine, pêche",m1:90740},{d1:"2008",d2:"Artisanat",m1:23480},{d1:"2019",d2:"Artisanat",m1:22180},{d1:"2008",d2:"Banque et assurances",m1:72450},{d1:"2019",d2:"Banque et assurances",m1:79300},{d1:"2008",d2:"Bâtiment, travaux publics",m1:247590},{d1:"2019",d2:"Bâtiment, travaux publics",m1:253200},{d1:"2008",d2:"Commerce",m1:344540},{d1:"2019",d2:"Commerce",m1:366020},{d1:"2008",d2:"Communication, information, art et spectacle",m1:49740},{d1:"2019",d2:"Communication, information, art et spectacle",m1:62430},{d1:"2008",d2:"Électricité, électronique",m1:34630},{d1:"2019",d2:"Électricité, électronique",m1:28960},{d1:"2008",d2:"Enseignement, formation",m1:152330},{d1:"2019",d2:"Enseignement, formation",m1:153290},{d1:"2008",d2:"Études et recherche",m1:46660},{d1:"2019",d2:"Études et recherche",m1:58830},{d1:"2008",d2:"Gestion, administration des entreprises",m1:341670},{d1:"2019",d2:"Gestion, administration des entreprises",m1:362760},{d1:"2008",d2:"Hôtellerie, restauration, alimentation",m1:143290},{d1:"2019",d2:"Hôtellerie, restauration, alimentation",m1:152020},{d1:"2008",d2:"Industries de process",m1:116200},{d1:"2019",d2:"Industries de process",m1:110850},{d1:"2008",d2:"Informatique et télécommunications",m1:52850},{d1:"2019",d2:"Informatique et télécommunications",m1:68140},{d1:"2008",d2:"Ingénieurs et cadres de l'industrie",m1:42160},{d1:"2019",d2:"Ingénieurs et cadres de l'industrie",m1:50460},{d1:"2008",d2:"Maintenance",m1:122610},{d1:"2019",d2:"Maintenance",m1:126900},{d1:"2008",d2:"Matériaux souples, bois, industries graphiques",m1:50070},{d1:"2019",d2:"Matériaux souples, bois, industries graphiques",m1:39650},{d1:"2008",d2:"Mécanique, travail des métaux",m1:145160},{d1:"2019",d2:"Mécanique, travail des métaux",m1:123620},{d1:"2008",d2:"Politique, religion",m1:3000},{d1:"2019",d2:"Politique, religion",m1:2820},{d1:"2008",d2:"Santé, action sociale, culturelle et sportive",m1:309880},{d1:"2019",d2:"Santé, action sociale, culturelle et sportive",m1:390510},{d1:"2008",d2:"Services aux particuliers et aux collectivités",m1:307730},{d1:"2019",d2:"Services aux particuliers et aux collectivités",m1:339210},{d1:"2008",d2:"Transports, logistique et tourisme",m1:230340},{d1:"2019",d2:"Transports, logistique et tourisme",m1:241290},]
};
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=['2008','2019',];
mydata["2008"] = [["Commerce",344540],["Gestion, administration des entreprises",341670],["Santé, action sociale, culturelle et sportive",309880],["Services aux particuliers et aux collectivités",307730],["Administration publique, professions juridiques, armée et police",253860],["Bâtiment, travaux publics",247590],["Transports, logistique et tourisme",230340],["Enseignement, formation",152330],["Mécanique, travail des métaux",145160],["Hôtellerie, restauration, alimentation",143290],["Maintenance",122610],["Industries de process",116200],["Agriculture, marine, pêche",97920],["Banque et assurances",72450],["Informatique et télécommunications",52850],["Matériaux souples, bois, industries graphiques",50070],["Communication, information, art et spectacle",49740],["Études et recherche",46660],["Ingénieurs et cadres de l'industrie",42160],["Électricité, électronique",34630],["Artisanat",23480],["Politique, religion",3000],];
mydata["2019"] = [["Santé, action sociale, culturelle et sportive",390510],["Commerce",366020],["Gestion, administration des entreprises",362760],["Services aux particuliers et aux collectivités",339210],["Administration publique, professions juridiques, armée et police",255360],["Bâtiment, travaux publics",253200],["Transports, logistique et tourisme",241290],["Enseignement, formation",153290],["Hôtellerie, restauration, alimentation",152020],["Maintenance",126900],["Mécanique, travail des métaux",123620],["Industries de process",110850],["Agriculture, marine, pêche",90740],["Banque et assurances",79300],["Informatique et télécommunications",68140],["Communication, information, art et spectacle",62430],["Études et recherche",58830],["Ingénieurs et cadres de l'industrie",50460],["Matériaux souples, bois, industries graphiques",39650],["Électricité, électronique",28960],["Artisanat",22180],["Politique, religion",2820],];
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: ".",
accessibility:{
chartContainerLabel: "{title}",
svgContainerLabel: "{title}",
},
},
colors : ["#491547","#985092","#D1BCDC","#005E5E","#00A6A5","#B2DDDF","#FCD12D","#F9B524",]
});
var chart = Highcharts.chart("container", {
chart: {
animation: {duration: 1900},
marginRight: 50,
backgroundColor: "#ffffff",
style: {
"fontFamily": "Lucida Sans Unicode",
"fontSize": "15px"
},
},
title: {
text: "",
style:{ color: "#000000",
fontFamily: "Arial",
fontSize: "12px",
fontWeight: "normal",
textDecoration: "none",
fontStyle: "normal" },
widthAdjust: -44,
align: "center"
},
subtitle: {
text: "",
style:{ color: "#848284",
fontFamily: "Arial",
fontSize: "10px",
fontWeight: "normal",
textDecoration: "none",
fontStyle: "normal" },
widthAdjust: -44,
align: "center"
},
xAxis: {
type: "category",
gridLineWidth: 0,
gridLineColor : "#e6e6e6",
lineWidth: 1,
lineColor : "#e6e6e6",
max: 21,
title: {text:"",
useHTML: true,
style:{ color: "#848284",
fontFamily: "Arial",
fontSize: "12px",
fontWeight: "normal",
textDecoration: "none",
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: "none",
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: "none",
fontStyle: "normal" }
},
},
legend: {
align: "right",
verticalAlign: "bottom",
itemStyle: {color: "#848284",
fontFamily: "Arial",
fontWeight: "bold",
fontSize: "20px",
textDecoration: "none",
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,
},
},
tooltip: {
headerFormat: '{series.name}
',
pointFormat: '
{point.name}
\u25CF Nb d\'actifs : {point.y}
',
borderWidth: 1,
valueDecimals: 0,
valuePrefix: '',
valueSuffix: ''
},
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: "none",
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);
}