Changeset View
Changeset View
Standalone View
Standalone View
src/applications/fact/controller/PhabricatorFactChartController.php
Show All 14 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$functions = array(); | $functions = array(); | ||||
$functions[] = id(new PhabricatorFactChartFunction()) | $functions[] = id(new PhabricatorFactChartFunction()) | ||||
->setArguments(array('tasks.count.create')); | ->setArguments(array('tasks.count.create')); | ||||
$functions[] = id(new PhabricatorFactChartFunction()) | $functions[] = id(new PhabricatorFactChartFunction()) | ||||
->setArguments(array('tasks.open-count.create')); | ->setArguments(array('tasks.open-count.create')); | ||||
if ($is_chart_mode) { | $functions[] = id(new PhabricatorConstantChartFunction()) | ||||
return $this->newChartResponse(); | ->setArguments(array(256)); | ||||
amckinley: This is setting the default argument to 256, right? I was looking for some reason why this to… | |||||
epriestleyAuthorUnsubmitted Done Inline ActionsThis is just drawing a visible line on the "demo" chart. 256 just happened to produce a reasonable line in the middle of the data on my local instance. epriestley: This is just drawing a visible line on the "demo" chart. 256 just happened to produce a… | |||||
} | |||||
$functions[] = id(new PhabricatorXChartFunction()) | |||||
->setArguments(array()); | |||||
list($domain_min, $domain_max) = $this->getDomain($functions); | list($domain_min, $domain_max) = $this->getDomain($functions); | ||||
$axis = id(new PhabricatorChartAxis()) | $axis = id(new PhabricatorChartAxis()) | ||||
->setMinimumValue($domain_min) | ->setMinimumValue($domain_min) | ||||
->setMaximumValue($domain_max); | ->setMaximumValue($domain_max); | ||||
$datasets = array(); | $datasets = array(); | ||||
Show All 34 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$chart_data = array( | $chart_data = array( | ||||
'datasets' => $datasets, | 'datasets' => $datasets, | ||||
'xMin' => $domain_min, | 'xMin' => $domain_min, | ||||
'xMax' => $domain_max, | 'xMax' => $domain_max, | ||||
'yMin' => $y_min, | 'yMin' => $y_min, | ||||
'yMax' => $y_max, | 'yMax' => $y_max, | ||||
); | ); | ||||
if ($is_chart_mode) { | |||||
return $this->newChartResponse(); | |||||
} | |||||
return id(new AphrontAjaxResponse())->setContent($chart_data); | return id(new AphrontAjaxResponse())->setContent($chart_data); | ||||
} | } | ||||
private function newChartResponse() { | private function newChartResponse() { | ||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$chart_node_id = celerity_generate_unique_node_id(); | $chart_node_id = celerity_generate_unique_node_id(); | ||||
$chart_view = phutil_tag( | $chart_view = phutil_tag( | ||||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |
This is setting the default argument to 256, right? I was looking for some reason why this to be a power of 2, maybe pick a different constant like 42?