router.html: Support babel cost and BATMAN V in neighbor graph

This patch uses the absolute value for plotting and removes the
graph maximum. A dynamic upper margin is introduced to prevent
overlap of data and legend.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-02-07 20:35:22 +01:00
parent 00ba4ace1b
commit 825f79aa66
1 changed files with 2 additions and 2 deletions

View File

@ -124,7 +124,7 @@ function neighbour_graph(neighbours) {
if(quality == null) {
quality = 0;
}
data.push([date_value, quality]);
data.push([date_value, Math.abs(quality)]);
}
catch(TypeError) {
// pass
@ -135,7 +135,7 @@ function neighbour_graph(neighbours) {
var plot = $.plot(meshstat, pdata, {
xaxis: {mode: "time", timezone: "browser"},
selection: {mode: "x"},
yaxis: {min: 0, max: 400},
yaxis: {min: 0, autoscaleMargin: 0.5},
legend: {noColumns: 2, hideable: true},
series: {downsample: {threshold: Math.floor(meshstat.width() * points_per_px)}}
});