public function executeMiniChart($request)
 {
     $interval = ReportPeer::getMeasurementInterval($this->report->getId());
     $x_labels = array($interval['first'], $interval['last']);
     $decorator = new ThumbnailChartDecorator($x_labels);
     $this->chart = ReportPeer::getReportChartt($this->report, $decorator);
 }
示例#2
0
 public function executeShowImage($request)
 {
     $id = $request->getParameter('id');
     ReportPeer::retrieveByPK(1);
     $report = sfPropelFriendlyUrl::retrieveByFriendlyUrl('Report', $id);
     $this->forward404Unless($report->getPublicRecord());
     $decorator = new PermanentChartDecorator();
     $chart = ReportPeer::getReportChartt($report, $decorator);
     $response = $this->getResponse();
     $response->clearHttpHeaders();
     $response->setContentType('image/png');
     $response->setContent(file_get_contents(sfConfig::get('app_web_images') . '/' . $chart->__toString()));
     $response->send();
 }