Differential D20817 Diff 49634 src/applications/project/chart/PhabricatorProjectBurndownChartEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/chart/PhabricatorProjectBurndownChartEngine.php
Show All 28 Lines | protected function newChart(PhabricatorFactChart $chart, array $map) { | ||||
} | } | ||||
$functions = array(); | $functions = array(); | ||||
if ($project_phids) { | if ($project_phids) { | ||||
foreach ($project_phids as $project_phid) { | foreach ($project_phids as $project_phid) { | ||||
$function = $this->newFunction( | $function = $this->newFunction( | ||||
array( | array( | ||||
'accumulate', | 'accumulate', | ||||
array( | |||||
'compose', | |||||
array('fact', 'tasks.open-count.assign.project', $project_phid), | array('fact', 'tasks.open-count.assign.project', $project_phid), | ||||
array('min', 0), | |||||
), | ), | ||||
array( | |||||
'min', | |||||
0, | |||||
)); | )); | ||||
$function->getFunctionLabel() | $function->getFunctionLabel() | ||||
->setName(pht('Tasks Moved Into Project')) | ->setName(pht('Tasks Moved Into Project')) | ||||
->setColor('rgba(0, 200, 200, 1)') | ->setColor('rgba(128, 128, 200, 1)') | ||||
->setFillColor('rgba(0, 200, 200, 0.15)'); | ->setFillColor('rgba(128, 128, 200, 0.15)'); | ||||
$functions[] = $function; | $functions[] = $function; | ||||
$function = $this->newFunction( | $function = $this->newFunction( | ||||
array( | array( | ||||
'accumulate', | 'accumulate', | ||||
array('fact', 'tasks.open-count.status.project', $project_phid), | array('fact', 'tasks.open-count.create.project', $project_phid), | ||||
), | |||||
array( | |||||
'min', | |||||
0, | |||||
)); | )); | ||||
$function->getFunctionLabel() | $function->getFunctionLabel() | ||||
->setName(pht('Tasks Reopened')) | ->setName(pht('Tasks Created')) | ||||
->setColor('rgba(200, 0, 200, 1)') | ->setColor('rgba(0, 0, 200, 1)') | ||||
->setFillColor('rgba(200, 0, 200, 0.15)'); | ->setFillColor('rgba(0, 0, 200, 0.15)'); | ||||
$functions[] = $function; | $functions[] = $function; | ||||
$function = $this->newFunction( | $function = $this->newFunction( | ||||
'sum', | |||||
array( | |||||
'accumulate', | |||||
array('fact', 'tasks.open-count.create.project', $project_phid), | |||||
), | |||||
array( | |||||
array( | array( | ||||
'accumulate', | 'accumulate', | ||||
array('fact', 'tasks.open-count.status.project', $project_phid), | |||||
), | |||||
array( | |||||
'max', | |||||
0, | |||||
), | |||||
), | |||||
array( | |||||
array( | array( | ||||
'accumulate', | 'compose', | ||||
array('fact', 'tasks.open-count.assign.project', $project_phid), | array('fact', 'tasks.open-count.assign.project', $project_phid), | ||||
array('max', 0), | |||||
), | ), | ||||
)); | |||||
$function->getFunctionLabel() | |||||
->setName(pht('Tasks Moved Out of Project')) | |||||
->setColor('rgba(128, 200, 128, 1)') | |||||
->setFillColor('rgba(128, 200, 128, 0.15)'); | |||||
$functions[] = $function; | |||||
$function = $this->newFunction( | |||||
array( | array( | ||||
'max', | 'accumulate', | ||||
0, | array('fact', 'tasks.open-count.status.project', $project_phid), | ||||
), | |||||
)); | )); | ||||
$function->getFunctionLabel() | $function->getFunctionLabel() | ||||
->setName(pht('Tasks Created')) | ->setName(pht('Tasks Closed')) | ||||
->setColor('rgba(0, 0, 200, 1)') | ->setColor('rgba(0, 200, 0, 1)') | ||||
->setFillColor('rgba(0, 0, 200, 0.15)'); | ->setFillColor('rgba(0, 200, 0, 0.15)'); | ||||
$functions[] = $function; | $functions[] = $function; | ||||
} | } | ||||
} else { | } else { | ||||
$function = $this->newFunction( | $function = $this->newFunction( | ||||
array( | |||||
'accumulate', | 'accumulate', | ||||
array('fact', 'tasks.open-count.create')); | array('fact', 'tasks.open-count.create'), | ||||
)); | |||||
$function->getFunctionLabel() | $function->getFunctionLabel() | ||||
->setName(pht('Tasks Created')) | ->setName(pht('Tasks Created')) | ||||
->setColor('rgba(0, 200, 200, 1)') | ->setColor('rgba(0, 0, 200, 1)') | ||||
->setFillColor('rgba(0, 200, 200, 0.15)'); | ->setFillColor('rgba(0, 0, 200, 0.15)'); | ||||
$functions[] = $function; | $functions[] = $function; | ||||
$function = $this->newFunction( | $function = $this->newFunction( | ||||
array( | |||||
'accumulate', | 'accumulate', | ||||
array('fact', 'tasks.open-count.status')); | array('fact', 'tasks.open-count.status'), | ||||
)); | |||||
$function->getFunctionLabel() | $function->getFunctionLabel() | ||||
->setName(pht('Tasks Closed / Reopened')) | ->setName(pht('Tasks Closed')) | ||||
->setColor('rgba(200, 0, 200, 1)') | ->setColor('rgba(0, 200, 0, 1)') | ||||
->setFillColor('rgba(200, 0, 200, 0.15)'); | ->setFillColor('rgba(0, 200, 0, 0.15)'); | ||||
$functions[] = $function; | $functions[] = $function; | ||||
} | } | ||||
$datasets = array(); | $datasets = array(); | ||||
$datasets[] = id(new PhabricatorChartStackedAreaDataset()) | $datasets[] = id(new PhabricatorChartStackedAreaDataset()) | ||||
->setFunctions($functions); | ->setFunctions($functions); | ||||
$chart->attachDatasets($datasets); | $chart->attachDatasets($datasets); | ||||
} | } | ||||
} | } |