From abb5c47b58f85c13387245e3bc32d2576b773430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 22 Oct 2022 22:14:23 +0200 Subject: [PATCH 1/3] Set tooltip interaction mode for overtime graphs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- scripts/pi-hole/js/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index f7e82765..a98a9bff 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -864,6 +864,10 @@ $(function () { options: { responsive: true, maintainAspectRatio: false, + interaction: { + mode: 'nearest', + axis: 'x', + }, plugins: { legend: { display: false, @@ -871,7 +875,6 @@ $(function () { tooltip: { enabled: true, intersect: false, - mode: "x", yAlign: "bottom", itemSort: function (a, b) { return b.datasetIndex - a.datasetIndex; @@ -972,6 +975,10 @@ $(function () { options: { responsive: true, maintainAspectRatio: false, + interaction: { + mode: 'nearest', + axis: 'x', + }, plugins: { legend: { display: false, @@ -980,7 +987,6 @@ $(function () { // Disable the on-canvas tooltip enabled: false, intersect: false, - mode: "x", external: customTooltips, yAlign: "top", itemSort: function (a, b) { From 74974244fc7ef06b8a4d70c38b804ceb48410065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 22 Oct 2022 22:18:39 +0200 Subject: [PATCH 2/3] Same for the long term graph MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- scripts/pi-hole/js/db_graph.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/db_graph.js b/scripts/pi-hole/js/db_graph.js index 4ca0fb6b..4223e738 100644 --- a/scripts/pi-hole/js/db_graph.js +++ b/scripts/pi-hole/js/db_graph.js @@ -236,12 +236,15 @@ $(function () { }, options: { responsive: true, + interaction: { + mode: 'nearest', + axis: 'x', + }, plugins: { tooltip: { enabled: true, yAlign: "bottom", intersect: false, - mode: "x", itemSort: function (a, b) { return b.datasetIndex - a.datasetIndex; }, From c5595903ae8a82fca6b39185cea603e75d5dd6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sat, 22 Oct 2022 22:20:57 +0200 Subject: [PATCH 3/3] Fix quotes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- scripts/pi-hole/js/db_graph.js | 4 ++-- scripts/pi-hole/js/index.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/pi-hole/js/db_graph.js b/scripts/pi-hole/js/db_graph.js index 4223e738..62a15ebc 100644 --- a/scripts/pi-hole/js/db_graph.js +++ b/scripts/pi-hole/js/db_graph.js @@ -237,8 +237,8 @@ $(function () { options: { responsive: true, interaction: { - mode: 'nearest', - axis: 'x', + mode: "nearest", + axis: "x", }, plugins: { tooltip: { diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index a98a9bff..d327aa4b 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -865,8 +865,8 @@ $(function () { responsive: true, maintainAspectRatio: false, interaction: { - mode: 'nearest', - axis: 'x', + mode: "nearest", + axis: "x", }, plugins: { legend: { @@ -976,8 +976,8 @@ $(function () { responsive: true, maintainAspectRatio: false, interaction: { - mode: 'nearest', - axis: 'x', + mode: "nearest", + axis: "x", }, plugins: { legend: {