<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]);
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); })
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,