mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 04:31:58 +01:00
chart fix for 1 datapoint
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
e606c785a2
commit
679e71ff4f
@ -53,6 +53,20 @@ class ModelStatChart extends Model {
|
|||||||
array_push($dates, date($date_format, $q['ts']));
|
array_push($dates, date($date_format, $q['ts']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there's a single data point, then we can't draw a line
|
||||||
|
// so we add an artificial value of 0
|
||||||
|
if(count($ydata) <= 1) {
|
||||||
|
if($timespan == "daily") {
|
||||||
|
$ts = NOW - (NOW % 3600) - 3600;
|
||||||
|
} else {
|
||||||
|
$ts = NOW - (NOW % 86400) - 86400;
|
||||||
|
}
|
||||||
|
|
||||||
|
array_push($ydata, 0);
|
||||||
|
array_push($dates, date($date_format, $ts));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if($query->num_rows >= 15) {
|
if($query->num_rows >= 15) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while(list($k, $v) = each($dates)) {
|
while(list($k, $v) = each($dates)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user