mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Fix computation of percentages in the over-time graph.
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -792,8 +792,9 @@ $(document).ready(function() {
|
||||
label: function(tooltipItems, data) {
|
||||
if (tooltipItems.datasetIndex === 1) {
|
||||
var percentage = 0.0;
|
||||
var total = parseInt(data.datasets[0].data[tooltipItems.index]);
|
||||
var permitted = parseInt(data.datasets[0].data[tooltipItems.index]);
|
||||
var blocked = parseInt(data.datasets[1].data[tooltipItems.index]);
|
||||
var total = permitted + blocked;
|
||||
if (total > 0) {
|
||||
percentage = (100.0 * blocked) / total;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user