Commit d506c719 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't draw stats graph until there are 2 points to plot


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 0c50cd84
......@@ -858,6 +858,12 @@ function graph_site_data_weekly() {
foreach ($weekly as &$r) {
$dataarray[$r->type][strftime("%d %b", $r->ts)] = $r->value;
}
foreach ($dataarray as &$t) {
// The graph will look nasty until we have 2 points to plot.
if (count($t) < 2) {
return;
}
}
require_once(get_config('libroot') . "pear/Image/Graph.php");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment