Simplify how data is passed to Long term graph (#2374)

This commit is contained in:
RD WebDesign
2022-09-27 15:19:44 -03:00
committed by GitHub
2 changed files with 2 additions and 13 deletions
-13
View File
@@ -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;
}
+2
View File
@@ -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();