From: Lunar <lunar@anargeek.net> Date: Sun, 17 Nov 2013 21:55:18 +0000 (+0100) Subject: Services : meilleur échelle verticale pour la bande passante X-Git-Url: https://www.nos-oignons.net/gitweb/website.git/commitdiff_plain/2cb8e87fc24531c4ee62a74e5bc4bb1bdaa67162 Services : meilleur échelle verticale pour la bande passante --- diff --git a/Services/Participation.html b/Services/Participation.html index 56ae6db..0d34eb0 100644 --- a/Services/Participation.html +++ b/Services/Participation.html @@ -164,12 +164,12 @@ new ExitPieDrawer().draw(); <script type="text/javascript"> -var margin = {top: 50, right: 90, bottom: 90, left: 90}, +var margin = {top: 50, right: 90, bottom: 90, left: 100}, width = 600 - margin.left - margin.right, height = 300 - margin.top - margin.bottom; var parseTime = d3.time.format("%Y-%m-%d %H:%M:%S").parse, - bwFormatter = d3.format(".2r"); + bwFormatter = d3.format(".1r"); var x = d3.time.scale() .range([0, width]); @@ -186,7 +186,7 @@ var xAxis = d3.svg.axis() var yAxis = d3.svg.axis() .scale(y) .orient("left") - .tickFormat(function(d) { return bwFormatter(d * 8 / (1000 * 1000)) + "Mbit/s"; }); + .tickFormat(function(d) { return bwFormatter(d) + "Â Mbit/s"; }); var area = d3.svg.area() .x(function(d) { return x(d.date); }) @@ -228,11 +228,11 @@ function draw_bandwidth_graph(raw_data, selector, direction, period) { var i = 0; for (var current = minTime; current <= maxTime; current = d3.time.second.offset(current, history.interval)) { if (first <= current && current <= last) { - values.push({ date: current, y: history.factor * history.values[i++] }); + values.push({ date: current, y: history.factor * history.values[i++] * 8 / 1000000 }); } } - maxTotalBandwidth = maxTotalBandwidth + history.factor * d3.max(history.values); + maxTotalBandwidth = maxTotalBandwidth + d3.max(values.map(function(d) { return d.y; })); return { fingerprint: fingerprint,