Differential D20498 Diff 48999 src/applications/project/chart/PhabricatorProjectBurndownChartEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/chart/PhabricatorProjectBurndownChartEngine.php
Show All 24 Lines | protected function newChart() { | ||||
} else { | } else { | ||||
$project_phids = null; | $project_phids = null; | ||||
} | } | ||||
$argvs = array(); | $argvs = array(); | ||||
if ($project_phids) { | if ($project_phids) { | ||||
foreach ($project_phids as $project_phid) { | foreach ($project_phids as $project_phid) { | ||||
$argvs[] = array( | $argvs[] = array( | ||||
'sum', | |||||
array( | |||||
'accumulate', | 'accumulate', | ||||
array('fact', 'tasks.open-count.create.project', $project_phid), | array('fact', 'tasks.open-count.create.project', $project_phid), | ||||
), | ); | ||||
array( | $argvs[] = array( | ||||
'accumulate', | 'accumulate', | ||||
array('fact', 'tasks.open-count.status.project', $project_phid), | array('fact', 'tasks.open-count.status.project', $project_phid), | ||||
), | ); | ||||
array( | $argvs[] = array( | ||||
'accumulate', | 'accumulate', | ||||
array('fact', 'tasks.open-count.assign.project', $project_phid), | array('fact', 'tasks.open-count.assign.project', $project_phid), | ||||
), | |||||
); | ); | ||||
} | } | ||||
} else { | } else { | ||||
$argvs[] = array( | $argvs[] = array('accumulate', array('fact', 'tasks.open-count.create')); | ||||
'sum', | $argvs[] = array('accumulate', array('fact', 'tasks.open-count.status')); | ||||
array('accumulate', array('fact', 'tasks.open-count.create')), | |||||
array('accumulate', array('fact', 'tasks.open-count.status')), | |||||
); | |||||
} | } | ||||
$datasets = array(); | $functions = array(); | ||||
foreach ($argvs as $argv) { | foreach ($argvs as $argv) { | ||||
$function = id(new PhabricatorComposeChartFunction()) | $functions[] = id(new PhabricatorComposeChartFunction()) | ||||
->setArguments(array($argv)); | ->setArguments(array($argv)); | ||||
$datasets[] = id(new PhabricatorChartDataset()) | |||||
->setFunction($function); | |||||
} | } | ||||
$datasets = array(); | |||||
$datasets[] = id(new PhabricatorChartStackedAreaDataset()) | |||||
->setFunctions($functions); | |||||
$chart = id(new PhabricatorFactChart()) | $chart = id(new PhabricatorFactChart()) | ||||
->setDatasets($datasets); | ->setDatasets($datasets); | ||||
return $chart; | return $chart; | ||||
} | } | ||||
} | } |