Skip to content

Commit

Permalink
Set tooltip interaction mode for overtime graphs (#2413)
Browse files Browse the repository at this point in the history
  • Loading branch information
yubiuser authored Oct 23, 2022
2 parents 39f23fd + c559590 commit aee9807
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion scripts/pi-hole/js/db_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
10 changes: 8 additions & 2 deletions scripts/pi-hole/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,14 +864,17 @@ $(function () {
options: {
responsive: true,
maintainAspectRatio: false,
interaction: {
mode: "nearest",
axis: "x",
},
plugins: {
legend: {
display: false,
},
tooltip: {
enabled: true,
intersect: false,
mode: "x",
yAlign: "bottom",
itemSort: function (a, b) {
return b.datasetIndex - a.datasetIndex;
Expand Down Expand Up @@ -972,6 +975,10 @@ $(function () {
options: {
responsive: true,
maintainAspectRatio: false,
interaction: {
mode: "nearest",
axis: "x",
},
plugins: {
legend: {
display: false,
Expand All @@ -980,7 +987,6 @@ $(function () {
// Disable the on-canvas tooltip
enabled: false,
intersect: false,
mode: "x",
external: customTooltips,
yAlign: "top",
itemSort: function (a, b) {
Expand Down

0 comments on commit aee9807

Please sign in to comment.