Skip to content

Instantly share code, notes, and snippets.

@ElisaDnr
Last active January 9, 2018 23:06
Show Gist options
  • Save ElisaDnr/2f318e04bb95c3952741ab4e5681131c to your computer and use it in GitHub Desktop.
Save ElisaDnr/2f318e04bb95c3952741ab4e5681131c to your computer and use it in GitHub Desktop.
Line Chart with pie chart json
license: gpl-3.0

This simple line chart is constructed from a TSV file storing the closing value of AAPL stock over the last few years. The chart employs conventional margins and a number of D3 features:

forked from mbostock's block: Line Chart

forked from ElisaDnr's block: Line Chart with pie chart

forked from ElisaDnr's block: Line Chart with pie chart json

<!DOCTYPE html>
<div id="pie"></div>
<svg width="960" height="500"></svg>
<style>
#pie svg{
position: absolute;
top: 50px;
left: 120px;
background-color: rgba(217, 217, 217, 0.5);
padding-top: 30px;
margin-left: 0px;
}
</style>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script>
d3.json("trajet_accident.json", function(data) {
var svg = d3.select("svg"),
margin = {
top: 20,
right: 20,
bottom: 30,
left: 50
},
width = +svg.attr("width") - margin.left - margin.right,
height = +svg.attr("height") - margin.top - margin.bottom,
g = svg.append("g").attr("transform", "translate(" + margin.left + "," + margin.top + ")");
svg.on("click", function(d){
document.getElementById("pie").innerHTML="";
d3.select(pointActuel).style("fill", "lightgrey").style("opacity", 0.4);
});
var parseTime = d3.timeParse("%I%M");
var x = d3.scaleTime()
.rangeRound([0, width]);
var y = d3.scaleLinear()
.rangeRound([height, 0]);
var line = d3.line()
.x(function(d) {
return x(d.heure);
})
.y(function(d) {
return y(d.nb_accident);
});
data.forEach(function(d) {
d.heure = parseTime(d.heure);
d.nb_accident = +d.nb_accident;
});
x.domain(d3.extent(data, function(d) {
return d.heure;
}));
y.domain(d3.extent(data, function(d) {
return d.nb_accident;
}));
g.append("g")
.attr("transform", "translate(0," + height + ")")
.call(d3.axisBottom(x))
.select(".domain")
.remove();
g.append("g")
.call(d3.axisLeft(y))
.append("text")
.attr("fill", "#000")
.attr("transform", "rotate(-90)")
.attr("y", 6)
.attr("dy", "0.71em")
.attr("text-anchor", "end")
.text("Nombre d'accidents");
g.append("path")
.datum(data)
.attr("fill", "none")
.attr("stroke", "steelblue")
.attr("stroke-linejoin", "round")
.attr("stroke-linecap", "round")
.attr("stroke-width", 1.5)
.attr("d", line);
g.selectAll("dot").data(data).enter().append("circle")
.attr("r", 6)
.attr("cx", function(d) { return x(d.heure); })
.attr("cy", function(d) { return y(d.nb_accident); })
.attr("fill", "lightgrey")
.style("opacity", 0.4)
.on("click", function(d) {
document.getElementById("pie").innerHTML="";
if (pointActuel != null) d3.select(pointActuel).style("fill", "lightgrey").style("opacity", 0.4);
d3.select(this).style("fill", "red").style("opacity", 1);
console.log(x(d.heure));
printPie(d.heure)
pointActuel = this;
if (event.stopPropagation) {
event.stopPropagation();
}
event.cancelBubble = true;
})
.on("mouseover", function(d) {
d3.select(this).style("fill", "blue").style("opacity", 1);
})
.on("mouseout", function(d) {
if(!(getHour(d.heure) == heureActuelle)){
d3.select(this).style("fill", "lightgrey").style("opacity", 0.4);
}
/*document.getElementById("pie").innerHTML="";*/
})
});
heureActuelle = "";
var pointActuel;
function printPie(heureBrut){
var heure = getHour(heureBrut);
heureActuelle = heure;
var pieWidth = 788;
var pieHeigth = 350;
var radius = Math.min(pieWidth, pieHeigth) / 2;
var x = d3.scaleTime()
.rangeRound([0, pieWidth]);
var arc = d3.arc()
.outerRadius(radius - 10)
.innerRadius(0);
var labelArc = d3.arc()
.outerRadius(radius - 40)
.innerRadius(radius - 40);
var pie = d3.pie()
.sort(null)
.value(function(d) { return d; })
;
var svg = d3.select("#pie").append("svg")
.attr("width", pieWidth)
.attr("height", pieHeigth)
.append("g")
.attr("transform", "translate(" + pieWidth / 2 + "," + pieHeigth / 2 + ")").attr("cx", function(d){return x(heureBrut)}).on("click", function(d) {
if (pointActuel != null) d3.select(pointActuel).style("fill", "lightgrey").style("opacity", 0.4);
});
console.log(svg);
d3.json("trajet_accident.json", function(data_json){
nb_accidents = 0;
for(var i=0; i<data_json.length; i++){
if(data_json[i].heure == heure){
var data = [data_json[i].nb_0, data_json[i].nb_1, data_json[i].nb_2, data_json[i].nb_3, data_json[i].nb_4, data_json[i].nb_5, data_json[i].nb_9,];
var color = d3.scaleOrdinal()
.range(["lightpink", "yellow", "green", "red", "lightblue", "lightgreen", "grey"])
.domain(data);
nb_accidents = data_json[i].nb_accident;
}
}
var g = svg.selectAll(".arc")
.data(pie(data))
.enter().append("g")
.attr("class", "arc");
console.log(g);
g.append("path")
.attr("d", arc)
.style("fill", function(d) { return color(d.data); });
g.append("text")
.attr("transform", function(d) { return "translate(" + labelArc.centroid(d) + ")"; })
.attr("dy", ".35em")
.text(function(d) { if(d.data == 0){return "";} else{return parseFloat(d.data).toFixed(2) + "%";}});
svg.append("text")
.attr("x", (pieWidth / 2)-385)
.attr("y", 0 - 175)
.attr("text-anchor", "middle")
.style("font-size", "16px")
.style("font-weight", "bold")
.text("Répartition des accidents (ici "+ nb_accidents +" accidents au total), par heure (ici "+ heureActuelle.substring(0,2) + "h" + heureActuelle.substring(2,4) +"), en fonction du trajet réalisé");
var legendRectSize = (radius * 0.05);
var legendSpacing = radius * 0.05;
var legend = svg.selectAll('.legend')
.data(color.domain())
.enter()
.append('g')
.attr('class', 'legend')
.attr('transform', function(d, i) {
var height = legendRectSize + legendSpacing;
var offset = height * color.domain().length / 2;
var horz = -3 * legendRectSize +200 ;
var vert = i * height - offset;
return 'translate(' + horz + ',' + vert + ')';
});
legend.append('rect')
.attr('width', legendRectSize)
.attr('height', legendRectSize)
.style('fill', color)
.style('stroke', color);
var j = 0;
var cat = ["Inconnu", "Domicile - Travail", "Domicile - Ecole", "Courses - Achats", "Utilisation professionnelle", "Promenade - Loisirs", "Autre"]
legend.append('text')
.attr('x', legendRectSize + legendSpacing)
.attr('y', legendRectSize - legendSpacing + 8)
.text(function(d) { var legendLabel = cat[j]; j++; return legendLabel; });
});
}
function getHour(fullHour){
var heure= "";
if(fullHour.getHours() > 9){
heure = fullHour.getHours();
}
else heure = "0" + fullHour.getHours();
if(fullHour.getMinutes() > 9){
heure += "" + fullHour.getMinutes();
}
else heure += "0" + fullHour.getMinutes();
return heure;
}
</script>
[
{"heure": "0000","nb_accident": "319","nb_0": "36.74074","nb_1": "5.185185","nb_2": "0.0","nb_3": "0.14814815","nb_4": "5.3333335","nb_5": "45.62963","nb_9": "6.962963"},
{"heure": "0015","nb_accident": "250","nb_0": "32.347504","nb_1": "4.066543","nb_2": "0.0","nb_3": "0.0","nb_4": "5.9149723","nb_5": "48.24399","nb_9": "9.426987"},
{"heure": "0030","nb_accident": "296","nb_0": "32.743362","nb_1": "3.2448378","nb_2": "0.0","nb_3": "0.0","nb_4": "5.6047196","nb_5": "51.917404","nb_9": "6.4896755"},
{"heure": "0045","nb_accident": "204","nb_0": "35.01144","nb_1": "4.576659","nb_2": "0.0","nb_3": "0.22883295","nb_4": "6.864989","nb_5": "46.22426","nb_9": "7.0938215"},
{"heure": "0100","nb_accident": "252","nb_0": "31.471136","nb_1": "3.1657357","nb_2": "0.18621974","nb_3": "0.0","nb_4": "4.4692736","nb_5": "54.934822","nb_9": "5.772812"},
{"heure": "0115","nb_accident": "211","nb_0": "34.004475","nb_1": "3.131991","nb_2": "0.0","nb_3": "0.22371365","nb_4": "7.158837","nb_5": "48.098434","nb_9": "7.3825502"},
{"heure": "0130","nb_accident": "202","nb_0": "34.660423","nb_1": "3.7470725","nb_2": "0.0","nb_3": "0.0","nb_4": "4.2154565","nb_5": "52.459015","nb_9": "4.9180326"},
{"heure": "0145","nb_accident": "191","nb_0": "34.35294","nb_1": "2.5882351","nb_2": "0.2352941","nb_3": "0.2352941","nb_4": "4.235294","nb_5": "50.82353","nb_9": "7.5294113"},
{"heure": "0200","nb_accident": "207","nb_0": "39.722862","nb_1": "3.6951501","nb_2": "0.23094688","nb_3": "0.0","nb_4": "3.926097","nb_5": "46.420322","nb_9": "6.0046186"},
{"heure": "0215","nb_accident": "174","nb_0": "35.120644","nb_1": "3.4852545","nb_2": "0.0","nb_3": "0.26809654","nb_4": "6.1662197","nb_5": "48.52547","nb_9": "6.434316"},
{"heure": "0230","nb_accident": "182","nb_0": "35.828876","nb_1": "4.2780747","nb_2": "0.0","nb_3": "0.0","nb_4": "5.0802135","nb_5": "49.19786","nb_9": "5.614973"},
{"heure": "0245","nb_accident": "158","nb_0": "38.43844","nb_1": "4.504504","nb_2": "0.0","nb_3": "0.0","nb_4": "9.60961","nb_5": "43.243244","nb_9": "4.204204"},
{"heure": "0300","nb_accident": "167","nb_0": "35.977337","nb_1": "4.249292","nb_2": "0.0","nb_3": "0.56657225","nb_4": "7.365439","nb_5": "46.458923","nb_9": "5.3824363"},
{"heure": "0315","nb_accident": "138","nb_0": "31.734318","nb_1": "4.4280443","nb_2": "0.0","nb_3": "0.0","nb_4": "6.2730627","nb_5": "52.029522","nb_9": "5.535055"},
{"heure": "0330","nb_accident": "159","nb_0": "30.952381","nb_1": "3.4013608","nb_2": "0.0","nb_3": "0.0","nb_4": "7.1428576","nb_5": "50.0","nb_9": "8.503401"},
{"heure": "0345","nb_accident": "111","nb_0": "32.627117","nb_1": "5.9322033","nb_2": "0.0","nb_3": "0.0","nb_4": "5.9322033","nb_5": "51.271187","nb_9": "4.2372885"},
{"heure": "0400","nb_accident": "159","nb_0": "35.384617","nb_1": "4.307692","nb_2": "0.0","nb_3": "0.0","nb_4": "8.0","nb_5": "46.76923","nb_9": "5.538461"},
{"heure": "0415","nb_accident": "129","nb_0": "31.128403","nb_1": "11.673152","nb_2": "0.0","nb_3": "0.0","nb_4": "8.1712055","nb_5": "43.968872","nb_9": "5.058366"},
{"heure": "0430","nb_accident": "145","nb_0": "28.275862","nb_1": "12.413793","nb_2": "0.0","nb_3": "0.0","nb_4": "10.689655","nb_5": "35.862072","nb_9": "12.75862"},
{"heure": "0445","nb_accident": "161","nb_0": "29.682997","nb_1": "15.561959","nb_2": "0.0","nb_3": "0.28818443","nb_4": "8.357349","nb_5": "40.34582","nb_9": "5.7636886"},
{"heure": "0500","nb_accident": "199","nb_0": "31.025642","nb_1": "16.153847","nb_2": "0.51282054","nb_3": "0.25641027","nb_4": "7.435898","nb_5": "42.05128","nb_9": "2.5641026"},
{"heure": "0515","nb_accident": "172","nb_0": "33.743843","nb_1": "17.73399","nb_2": "0.0","nb_3": "0.0","nb_4": "6.403941","nb_5": "37.931034","nb_9": "4.187192"},
{"heure": "0530","nb_accident": "249","nb_0": "24.478178","nb_1": "20.872866","nb_2": "0.0","nb_3": "0.0","nb_4": "10.436433","nb_5": "40.986717","nb_9": "3.2258062"},
{"heure": "0545","nb_accident": "235","nb_0": "28.246012","nb_1": "25.512527","nb_2": "0.0","nb_3": "0.4555809","nb_4": "10.933941","nb_5": "30.751709","nb_9": "4.100228"},
{"heure": "0600","nb_accident": "302","nb_0": "25.236591","nb_1": "22.555204","nb_2": "0.63091487","nb_3": "0.15772872","nb_4": "11.198738","nb_5": "35.173504","nb_9": "5.047319"},
{"heure": "0615","nb_accident": "241","nb_0": "22.0202","nb_1": "27.676767","nb_2": "0.40404043","nb_3": "0.60606056","nb_4": "10.505051","nb_5": "32.32323","nb_9": "6.464647"},
{"heure": "0630","nb_accident": "312","nb_0": "28.257687","nb_1": "30.161053","nb_2": "0.5856515","nb_3": "0.8784773","nb_4": "12.445095","nb_5": "23.426062","nb_9": "4.2459736"},
{"heure": "0645","nb_accident": "368","nb_0": "29.455444","nb_1": "33.910892","nb_2": "0.86633664","nb_3": "0.86633664","nb_4": "10.519802","nb_5": "19.430693","nb_9": "4.9504952"},
{"heure": "0700","nb_accident": "466","nb_0": "25.423729","nb_1": "37.188435","nb_2": "3.1904287","nb_3": "0.49850446","nb_4": "13.3599205","nb_5": "16.051844","nb_9": "4.2871385"},
{"heure": "0715","nb_accident": "522","nb_0": "23.097582","nb_1": "37.332138","nb_2": "5.2820053","nb_3": "0.7162041","nb_4": "12.354521","nb_5": "15.846016","nb_9": "5.3715305"},
{"heure": "0730","nb_accident": "726","nb_0": "24.424553","nb_1": "37.659847","nb_2": "10.421995","nb_3": "0.8951407","nb_4": "10.230179","nb_5": "11.06138","nb_9": "5.3069057"},
{"heure": "0745","nb_accident": "875","nb_0": "24.587545","nb_1": "34.53965","nb_2": "10.4843","nb_3": "1.2772751","nb_4": "10.377861","nb_5": "11.335817","nb_9": "7.397552"},
{"heure": "0800","nb_accident": "972","nb_0": "25.98086","nb_1": "33.636364","nb_2": "8.325358","nb_3": "1.6267942","nb_4": "11.818182","nb_5": "13.875598","nb_9": "4.736842"},
{"heure": "0815","nb_accident": "813","nb_0": "21.5965","nb_1": "34.28103","nb_2": "11.208311","nb_3": "1.2028431","nb_4": "11.536358","nb_5": "13.668672","nb_9": "6.506287"},
{"heure": "0830","nb_accident": "985","nb_0": "25.313517","nb_1": "30.747795","nb_2": "6.920576","nb_3": "1.5791919","nb_4": "12.354854","nb_5": "16.813747","nb_9": "6.270321"},
{"heure": "0845","nb_accident": "911","nb_0": "25.948406","nb_1": "28.679817","nb_2": "5.5134044","nb_3": "1.8715225","nb_4": "11.532625","nb_5": "21.092564","nb_9": "5.361659"},
{"heure": "0900","nb_accident": "939","nb_0": "28.108109","nb_1": "25.601965","nb_2": "2.9975429","nb_3": "2.1621623","nb_4": "13.366093","nb_5": "20.786242","nb_9": "6.9778867"},
{"heure": "0915","nb_accident": "738","nb_0": "27.859777","nb_1": "23.493235","nb_2": "3.0750308","nb_3": "3.6900368","nb_4": "12.97663","nb_5": "24.16974","nb_9": "4.735547"},
{"heure": "0930","nb_accident": "769","nb_0": "28.380838","nb_1": "18.981201","nb_2": "2.0012128","nb_3": "3.6992118","nb_4": "14.129776","nb_5": "26.682838","nb_9": "6.124924"},
{"heure": "0945","nb_accident": "625","nb_0": "29.276773","nb_1": "14.812239","nb_2": "1.5299027","nb_3": "4.381085","nb_4": "15.855354","nb_5": "27.885952","nb_9": "6.2586927"},
{"heure": "1000","nb_accident": "767","nb_0": "26.783556","nb_1": "11.608222","nb_2": "1.6324064","nb_3": "5.92503","nb_4": "13.361547","nb_5": "34.885128","nb_9": "5.804111"},
{"heure": "1015","nb_accident": "638","nb_0": "29.117445","nb_1": "9.5205","nb_2": "0.9728978","nb_3": "5.7678947","nb_4": "15.427381","nb_5": "33.773457","nb_9": "5.4204307"},
{"heure": "1030","nb_accident": "766","nb_0": "30.119762","nb_1": "8.2634735","nb_2": "0.95808387","nb_3": "5.7485027","nb_4": "12.57485","nb_5": "35.568863","nb_9": "6.7664666"},
{"heure": "1045","nb_accident": "602","nb_0": "27.511246","nb_1": "7.4212894","nb_2": "0.8245877","nb_3": "5.5472264","nb_4": "12.893553","nb_5": "38.005997","nb_9": "7.796102"},
{"heure": "1100","nb_accident": "798","nb_0": "28.563381","nb_1": "7.8309855","nb_2": "1.3521127","nb_3": "4.9577465","nb_4": "12.901409","nb_5": "36.84507","nb_9": "7.5492954"},
{"heure": "1115","nb_accident": "681","nb_0": "31.45631","nb_1": "6.084142","nb_2": "0.90614885","nb_3": "4.8543687","nb_4": "12.23301","nb_5": "38.4466","nb_9": "6.019418"},
{"heure": "1130","nb_accident": "761","nb_0": "28.079096","nb_1": "6.6101694","nb_2": "1.8079096","nb_3": "5.19774","nb_4": "12.711864","nb_5": "37.909603","nb_9": "7.683616"},
{"heure": "1145","nb_accident": "750","nb_0": "29.094076","nb_1": "8.478514","nb_2": "3.3101044","nb_3": "5.110337","nb_4": "11.962834","nb_5": "36.875725","nb_9": "5.168409"},
{"heure": "1200","nb_accident": "884","nb_0": "29.025534","nb_1": "11.412193","nb_2": "3.9082856","nb_3": "3.2308493","nb_4": "12.975508","nb_5": "31.474728","nb_9": "7.972903"},
{"heure": "1215","nb_accident": "835","nb_0": "28.710197","nb_1": "12.628171","nb_2": "3.291959","nb_3": "2.8602266","nb_4": "12.898003","nb_5": "33.459255","nb_9": "6.152186"},
{"heure": "1230","nb_accident": "772","nb_0": "29.1954","nb_1": "13.103448","nb_2": "2.5287356","nb_3": "4.022989","nb_4": "12.988506","nb_5": "32.471264","nb_9": "5.6896553"},
{"heure": "1245","nb_accident": "649","nb_0": "27.33711","nb_1": "12.252125","nb_2": "2.9036827","nb_3": "2.7620397","nb_4": "14.022663","nb_5": "34.77337","nb_9": "5.9490085"},
{"heure": "1300","nb_accident": "736","nb_0": "28.912634","nb_1": "12.067882","nb_2": "3.3940918","nb_3": "2.388435","nb_4": "10.245129","nb_5": "35.76367","nb_9": "7.2281585"},
{"heure": "1315","nb_accident": "685","nb_0": "30.19355","nb_1": "12.258064","nb_2": "3.548387","nb_3": "2.1290324","nb_4": "13.419355","nb_5": "31.35484","nb_9": "7.096774"},
{"heure": "1330","nb_accident": "822","nb_0": "31.044111","nb_1": "11.836963","nb_2": "2.903406","nb_3": "2.0100503","nb_4": "11.781128","nb_5": "33.835846","nb_9": "6.5884976"},
{"heure": "1345","nb_accident": "757","nb_0": "29.902802","nb_1": "11.549458","nb_2": "1.8867924","nb_3": "2.3441966","nb_4": "11.37793","nb_5": "36.30646","nb_9": "6.6323614"},
{"heure": "1400","nb_accident": "943","nb_0": "30.336058","nb_1": "10.17257","nb_2": "2.270663","nb_3": "2.5431426","nb_4": "11.943687","nb_5": "36.05813","nb_9": "6.6757493"},
{"heure": "1415","nb_accident": "747","nb_0": "29.020557","nb_1": "10.217654","nb_2": "0.60459495","nb_3": "2.4183798","nb_4": "11.729141","nb_5": "39.54051","nb_9": "6.4691653"},
{"heure": "1430","nb_accident": "902","nb_0": "31.535065","nb_1": "9.220206","nb_2": "1.2751348","nb_3": "2.8935752","nb_4": "10.49534","nb_5": "39.283962","nb_9": "5.2967143"},
{"heure": "1445","nb_accident": "760","nb_0": "31.335617","nb_1": "6.678082","nb_2": "0.913242","nb_3": "4.394977","nb_4": "9.9885845","nb_5": "40.068493","nb_9": "6.6210046"},
{"heure": "1500","nb_accident": "998","nb_0": "30.892548","nb_1": "7.755633","nb_2": "1.3864818","nb_3": "3.0762565","nb_4": "11.568458","nb_5": "38.86482","nb_9": "6.455806"},
{"heure": "1515","nb_accident": "824","nb_0": "28.787062","nb_1": "8.409703","nb_2": "2.3180592","nb_3": "2.857143","nb_4": "10.296496","nb_5": "40.808624","nb_9": "6.522911"},
{"heure": "1530","nb_accident": "938","nb_0": "31.470173","nb_1": "6.998591","nb_2": "1.9257867","nb_3": "3.42884","nb_4": "10.192579","nb_5": "39.643024","nb_9": "6.3410053"},
{"heure": "1545","nb_accident": "881","nb_0": "30.987951","nb_1": "6.5060244","nb_2": "1.4457831","nb_3": "2.8915663","nb_4": "9.156627","nb_5": "42.457832","nb_9": "6.554217"},
{"heure": "1600","nb_accident": "1108","nb_0": "31.69678","nb_1": "7.5412416","nb_2": "3.33857","nb_3": "3.417125","nb_4": "10.015711","nb_5": "38.020424","nb_9": "5.970149"},
{"heure": "1615","nb_accident": "969","nb_0": "31.310575","nb_1": "8.807417","nb_2": "2.9919932","nb_3": "2.191319","nb_4": "7.964602","nb_5": "40.328697","nb_9": "6.4053936"},
{"heure": "1630","nb_accident": "1157","nb_0": "31.268656","nb_1": "8.768657","nb_2": "2.8731341","nb_3": "3.5074625","nb_4": "9.216418","nb_5": "38.097015","nb_9": "6.268657"},
{"heure": "1645","nb_accident": "1025","nb_0": "31.559404","nb_1": "9.818481","nb_2": "3.1353135","nb_3": "2.970297","nb_4": "7.9620466","nb_5": "38.490097","nb_9": "6.0643563"},
{"heure": "1700","nb_accident": "1259","nb_0": "30.034966","nb_1": "12.132868","nb_2": "2.8321679","nb_3": "3.2867134","nb_4": "7.9020977","nb_5": "37.622375","nb_9": "6.1888113"},
{"heure": "1715","nb_accident": "1161","nb_0": "30.063408","nb_1": "12.30884","nb_2": "2.461768","nb_3": "3.2450578","nb_4": "6.452816","nb_5": "38.903393","nb_9": "6.564715"},
{"heure": "1730","nb_accident": "1310","nb_0": "32.07788","nb_1": "13.501437","nb_2": "2.4577084","nb_3": "3.096074","nb_4": "6.5432496","nb_5": "36.61028","nb_9": "5.7133737"},
{"heure": "1745","nb_accident": "1251","nb_0": "30.394825","nb_1": "13.13819","nb_2": "2.3485365","nb_3": "3.4377127","nb_4": "5.4118447","nb_5": "38.22328","nb_9": "7.0456095"},
{"heure": "1800","nb_accident": "1432","nb_0": "33.037247","nb_1": "11.690544","nb_2": "1.8624641","nb_3": "3.2951288","nb_4": "5.9598856","nb_5": "38.13754","nb_9": "6.017192"},
{"heure": "1815","nb_accident": "1168","nb_0": "30.178377","nb_1": "15.216599","nb_2": "1.3105205","nb_3": "2.839461","nb_4": "5.7881327","nb_5": "39.315617","nb_9": "5.351292"},
{"heure": "1830","nb_accident": "1293","nb_0": "30.736217","nb_1": "13.436778","nb_2": "1.4196104","nb_3": "2.542093","nb_4": "6.569825","nb_5": "38.659622","nb_9": "6.635854"},
{"heure": "1845","nb_accident": "1028","nb_0": "33.444817","nb_1": "12.667224","nb_2": "0.83612037","nb_3": "2.7591972","nb_4": "5.1421404","nb_5": "39.005016","nb_9": "6.145485"},
{"heure": "1900","nb_accident": "1123","nb_0": "31.605032","nb_1": "12.00915","nb_2": "0.76248574","nb_3": "3.1643157","nb_4": "5.223027","nb_5": "40.869232","nb_9": "6.366756"},
{"heure": "1915","nb_accident": "879","nb_0": "31.994047","nb_1": "11.656746","nb_2": "0.49603176","nb_3": "2.1825397","nb_4": "5.357143","nb_5": "42.261906","nb_9": "6.051587"},
{"heure": "1930","nb_accident": "981","nb_0": "32.090546","nb_1": "12.250333","nb_2": "0.3994674","nb_3": "2.2192633","nb_4": "6.6134043","nb_5": "39.4585","nb_9": "6.9684863"},
{"heure": "1945","nb_accident": "801","nb_0": "33.00384","nb_1": "11.202636","nb_2": "0.38440418","nb_3": "1.9220209","nb_4": "4.5030203","nb_5": "42.888523","nb_9": "6.095552"},
{"heure": "2000","nb_accident": "852","nb_0": "33.50622","nb_1": "9.958507","nb_2": "0.36307055","nb_3": "1.86722","nb_4": "5.549793","nb_5": "42.47925","nb_9": "6.275934"},
{"heure": "2015","nb_accident": "640","nb_0": "31.275719","nb_1": "10.150891","nb_2": "0.1371742","nb_3": "1.4403292","nb_4": "6.8587103","nb_5": "42.935528","nb_9": "7.2016463"},
{"heure": "2030","nb_accident": "643","nb_0": "32.895695","nb_1": "9.8468275","nb_2": "0.3646973","nb_3": "1.0940919","nb_4": "7.5127645","nb_5": "41.648434","nb_9": "6.6374907"},
{"heure": "2045","nb_accident": "530","nb_0": "31.551271","nb_1": "8.238387","nb_2": "0.26292726","nb_3": "1.2269938","nb_4": "5.872042","nb_5": "45.6617","nb_9": "7.186678"},
{"heure": "2100","nb_accident": "552","nb_0": "34.829594","nb_1": "7.3150454","nb_2": "0.083125524","nb_3": "0.74812967","nb_4": "7.98005","nb_5": "42.31089","nb_9": "6.733167"},
{"heure": "2115","nb_accident": "474","nb_0": "33.268673","nb_1": "7.468477","nb_2": "0.19398643","nb_3": "0.67895246","nb_4": "6.886518","nb_5": "44.034916","nb_9": "7.468477"},
{"heure": "2130","nb_accident": "476","nb_0": "32.53012","nb_1": "6.124498","nb_2": "0.0","nb_3": "0.70281124","nb_4": "8.73494","nb_5": "43.674698","nb_9": "8.232932"},
{"heure": "2145","nb_accident": "396","nb_0": "33.522083","nb_1": "7.92752","nb_2": "0.0","nb_3": "0.11325028","nb_4": "3.96376","nb_5": "43.48811","nb_9": "10.985277"},
{"heure": "2200","nb_accident": "399","nb_0": "34.069767","nb_1": "4.883721","nb_2": "0.3488372","nb_3": "0.46511626","nb_4": "7.5581393","nb_5": "45.0","nb_9": "7.6744184"},
{"heure": "2215","nb_accident": "358","nb_0": "35.900784","nb_1": "4.1775455","nb_2": "0.1305483","nb_3": "1.0443864","nb_4": "6.1357703","nb_5": "43.342037","nb_9": "9.2689295"},
{"heure": "2230","nb_accident": "413","nb_0": "30.042463","nb_1": "5.944798","nb_2": "0.0","nb_3": "0.21231423","nb_4": "6.1571126","nb_5": "50.530785","nb_9": "7.112527"},
{"heure": "2245","nb_accident": "307","nb_0": "30.966768","nb_1": "4.833837","nb_2": "0.0","nb_3": "0.1510574","nb_4": "4.6827793","nb_5": "53.47432","nb_9": "5.8912387"},
{"heure": "2300","nb_accident": "356","nb_0": "34.70968","nb_1": "4.516129","nb_2": "0.12903227","nb_3": "0.25806454","nb_4": "5.806452","nb_5": "46.451614","nb_9": "8.129032"},
{"heure": "2315","nb_accident": "310","nb_0": "36.417034","nb_1": "6.020558","nb_2": "0.14684288","nb_3": "0.5873715","nb_4": "5.5800295","nb_5": "45.81498","nb_9": "5.4331865"},
{"heure": "2330","nb_accident": "354","nb_0": "30.982368","nb_1": "4.534005","nb_2": "0.12594458","nb_3": "0.12594458","nb_4": "5.289673","nb_5": "52.14106","nb_9": "6.8010077"},
{"heure": "2345","nb_accident": "297","nb_0": "32.21374","nb_1": "3.5114505","nb_2": "0.0","nb_3": "0.45801526","nb_4": "5.9541984","nb_5": "52.21374","nb_9": "5.648855"}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment