mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Simplify how data is passed to Long term graph (#2374)
This commit is contained in:
-13
@@ -339,19 +339,6 @@ if (isset($_GET['getGraphData']) && $auth) {
|
||||
}
|
||||
}
|
||||
|
||||
// It is unpredictable what the first timestamp returned by the database
|
||||
// will be. This depends on live data. Hence, we re-align the FROM
|
||||
// timestamp to avoid unaligned holes appearing as additional
|
||||
// (incorrect) data points
|
||||
$aligned_from = $from + (($first_db_timestamp - $from) % $interval);
|
||||
|
||||
// Fill gaps in returned data
|
||||
for ($i = $aligned_from; $i < $until; $i += $interval) {
|
||||
if (!array_key_exists($i, $data)) {
|
||||
$data[$i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,6 +196,8 @@ function updateQueriesOverTime() {
|
||||
}
|
||||
}
|
||||
|
||||
timeLineChart.options.scales.xAxes[0].ticks.min = from * 1000;
|
||||
timeLineChart.options.scales.xAxes[0].ticks.max = until * 1000;
|
||||
timeLineChart.options.scales.xAxes[0].display = true;
|
||||
$("#queries-over-time .overlay").hide();
|
||||
timeoutWarning.hide();
|
||||
|
||||
Reference in New Issue
Block a user