mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 18:34:30 -04:00
Working on charts
This commit is contained in:
parent
f131b2720a
commit
ddac73b2ea
@ -209,30 +209,16 @@ class AbstractReport
|
|||||||
$endDate = date_create($this->endDate);
|
$endDate = date_create($this->endDate);
|
||||||
$groupBy = $this->chartGroupBy();
|
$groupBy = $this->chartGroupBy();
|
||||||
|
|
||||||
/*
|
|
||||||
if ($groupBy == 'DAY') {
|
|
||||||
$groupBy = 'DAYOFYEAR';
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
$datasets = [];
|
$datasets = [];
|
||||||
$labels = [];
|
$labels = [];
|
||||||
|
|
||||||
foreach ($this->chartData as $dimension => $data) {
|
foreach ($this->chartData as $dimension => $data) {
|
||||||
$endDate->modify('+1 '.$groupBy);
|
|
||||||
$interval = new DateInterval('P1'.substr($groupBy, 0, 1));
|
$interval = new DateInterval('P1'.substr($groupBy, 0, 1));
|
||||||
$period = new DatePeriod($startDate, $interval, $endDate);
|
$period = new DatePeriod($startDate, $interval, $endDate);
|
||||||
$endDate->modify('-1 '.$groupBy);
|
|
||||||
$records = [];
|
$records = [];
|
||||||
|
|
||||||
foreach ($period as $date) {
|
foreach ($period as $date) {
|
||||||
$labels[] = $date->format('m/d/Y');
|
$labels[] = $date->format('m/d/Y');
|
||||||
/*
|
|
||||||
if ($entityType == ENTITY_INVOICE) {
|
|
||||||
$labels[] = $d->format('m/d/Y');
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
$date = $this->formatDate($date);
|
$date = $this->formatDate($date);
|
||||||
$records[] = isset($data[$date]) ? $data[$date] : 0;
|
$records[] = isset($data[$date]) ? $data[$date] : 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user