Path: blob/master/src/applications/fact/engine/PhabricatorDemoChartEngine.php
12256 views
<?php12final class PhabricatorDemoChartEngine3extends PhabricatorChartEngine {45const CHARTENGINEKEY = 'facts.demo';67protected function newChart(PhabricatorFactChart $chart, array $map) {8$viewer = $this->getViewer();910$functions = array();1112$function = $this->newFunction(13array('scale', 0.0001),14array('cos'),15array('scale', 128),16array('shift', 256));1718$function->getFunctionLabel()19->setKey('cos-x')20->setName(pht('cos(x)'))21->setColor('rgba(0, 200, 0, 1)')22->setFillColor('rgba(0, 200, 0, 0.15)');2324$functions[] = $function;2526$function = $this->newFunction(27array('constant', 345));2829$function->getFunctionLabel()30->setKey('constant-345')31->setName(pht('constant(345)'))32->setColor('rgba(0, 0, 200, 1)')33->setFillColor('rgba(0, 0, 200, 0.15)');3435$functions[] = $function;3637$datasets = array();3839$datasets[] = id(new PhabricatorChartStackedAreaDataset())40->setFunctions($functions);4142$chart->attachDatasets($datasets);43}4445}464748