Remove legend, add tooltips and increase hit/hover radius for Query Types over Time graph. Fixes #502

This commit is contained in:
DL6ER
2017-05-13 17:34:36 +02:00
parent 7d4bf08853
commit e659d79da9
+25
View File
@@ -612,16 +612,41 @@ $(document).ready(function() {
{
label: "A: IPv4 queries",
pointRadius: 0,
pointHitRadius: 5,
pointHoverRadius: 5,
data: []
},
{
label: "AAAA: IPv6 queries",
pointRadius: 0,
pointHitRadius: 5,
pointHoverRadius: 5,
data: []
}
]
},
options: {
tooltips: {
enabled: true,
mode: "x-axis",
callbacks: {
title: function(tooltipItem, data) {
var label = tooltipItem[0].xLabel;
var time = label.match(/(\d?\d):?(\d?\d?)/);
var h = parseInt(time[1], 10);
var m = parseInt(time[2], 10) || 0;
var from = padNumber(h)+":"+padNumber(m-5)+":00";
var to = padNumber(h)+":"+padNumber(m+4)+":59";
return "Query types from "+from+" to "+to;
},
label: function(tooltipItems, data) {
return data.datasets[tooltipItems.datasetIndex].label + ": " + (100.0*tooltipItems.yLabel).toFixed(1) + "%";
}
}
},
legend: {
display: false
},
scales: {
xAxes: [{
type: "time",