getStaticGraph() public static method

public static getStaticGraph ( $reportMetadata, $width, $height, $evolution, $segment )
Beispiel #1
0
 private function createAttachment($report, $processedReport, $prettyDate)
 {
     $additionalFile = array();
     $segment = self::getSegment($report['idsegment']);
     $segmentName = $segment != null ? sprintf(' (%s)', $segment['name']) : '';
     $processedReportMetadata = $processedReport['metadata'];
     $additionalFile['filename'] = sprintf('%s - %s - %s %d - %s %d%s.png', $processedReportMetadata['name'], $prettyDate, Piwik::translate('General_Website'), $report['idsite'], Piwik::translate('General_Report'), $report['idreport'], $segmentName);
     $additionalFile['cid'] = $processedReportMetadata['uniqueId'];
     $additionalFile['content'] = ReportRenderer::getStaticGraph($processedReportMetadata, Html::IMAGE_GRAPH_WIDTH, Html::IMAGE_GRAPH_HEIGHT, $processedReport['evolutionGraph'], $segment);
     $additionalFile['mimeType'] = 'image/png';
     $additionalFile['encoding'] = Zend_Mime::ENCODING_BASE64;
     return $additionalFile;
 }
Beispiel #2
0
 private function paintGraph()
 {
     $imageGraph = parent::getStaticGraph($this->reportMetadata, $this->orientation == self::PORTRAIT ? self::IMAGE_GRAPH_WIDTH_PORTRAIT : self::IMAGE_GRAPH_WIDTH_LANDSCAPE, self::IMAGE_GRAPH_HEIGHT, $this->evolutionGraph, $this->segment);
     $this->TCPDF->Image('@' . $imageGraph, $x = '', $y = '', $w = 0, $h = 0, $type = '', $link = '', $align = 'N', $resize = false, $dpi = 72, $palign = '', $ismask = false, $imgmask = false, $order = 0, $fitbox = false, $hidden = false, $fitonpage = true, $alt = false, $altimgs = array());
     unset($imageGraph);
 }
Beispiel #3
0
 public function renderReport($processedReport)
 {
     $reportView = new View('@CoreHome/ReportRenderer/_htmlReportBody');
     $this->assignCommonParameters($reportView);
     $reportMetadata = $processedReport['metadata'];
     $reportData = $processedReport['reportData'];
     $columns = $processedReport['columns'];
     list($reportData, $columns) = self::processTableFormat($reportMetadata, $reportData, $columns);
     $reportView->assign("reportName", $reportMetadata['name']);
     $reportView->assign("reportId", $reportMetadata['uniqueId']);
     $reportView->assign("reportColumns", $columns);
     $reportView->assign("reportRows", $reportData->getRows());
     $reportView->assign("reportRowsMetadata", $processedReport['reportMetadata']->getRows());
     $reportView->assign("displayTable", $processedReport['displayTable']);
     $displayGraph = $processedReport['displayGraph'];
     $evolutionGraph = $processedReport['evolutionGraph'];
     $reportView->assign("displayGraph", $displayGraph);
     if ($displayGraph) {
         $reportView->assign("graphWidth", self::IMAGE_GRAPH_WIDTH);
         $reportView->assign("graphHeight", self::IMAGE_GRAPH_HEIGHT);
         $reportView->assign("renderImageInline", $this->renderImageInline);
         if ($this->renderImageInline) {
             $staticGraph = parent::getStaticGraph($reportMetadata, self::IMAGE_GRAPH_WIDTH, self::IMAGE_GRAPH_HEIGHT, $evolutionGraph, $processedReport['segment']);
             $reportView->assign("generatedImageGraph", base64_encode($staticGraph));
             unset($generatedImageGraph);
         }
     }
     $this->rendering .= $reportView->render();
 }