diff options
author | JulienMoumne <julien@piwik.org> | 2012-09-06 17:51:06 +0400 |
---|---|---|
committer | JulienMoumne <julien@piwik.org> | 2012-09-06 17:51:06 +0400 |
commit | 71b487c3aa93704594e29c758a8f983267fb3545 (patch) | |
tree | 7a25a623cd0ff1582fdfe041a5b19be4c914988e /core/ReportRenderer/Pdf.php | |
parent | 5bf0108b1f6d8ac0c584e5d796e608fd25ff580e (diff) |
refs #3158
* adding more report exceptions from being filtered by AddColumnProcessedMetrics filter
* I forgot to manage an edge case when $label=false and there are no data, what should the API return ? see @review
* only retrieve the last period when looking for top n labels
refs #3013
* better error message when specifying invalid metrics in $columns
* same image height for all graph types in all page orientations for pdf reports
git-svn-id: http://dev.piwik.org/svn/trunk@6925 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/ReportRenderer/Pdf.php')
-rw-r--r-- | core/ReportRenderer/Pdf.php | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/core/ReportRenderer/Pdf.php b/core/ReportRenderer/Pdf.php index 40bcf94ad7..f2468745a0 100644 --- a/core/ReportRenderer/Pdf.php +++ b/core/ReportRenderer/Pdf.php @@ -24,9 +24,8 @@ require_once PIWIK_INCLUDE_PATH . '/core/TCPDF.php'; class Piwik_ReportRenderer_Pdf extends Piwik_ReportRenderer { const IMAGE_GRAPH_WIDTH_LANDSCAPE = 1050; - const IMAGE_GRAPH_HEIGHT_LANDSCAPE = 330; const IMAGE_GRAPH_WIDTH_PORTRAIT = 760; - const IMAGE_GRAPH_HEIGHT_PORTRAIT = 220; + const IMAGE_GRAPH_HEIGHT = 220; const LANDSCAPE = 'L'; const PORTRAIT = 'P'; @@ -398,22 +397,12 @@ class Piwik_ReportRenderer_Pdf extends Piwik_ReportRenderer } private function paintGraph() { - - if($this->orientation == self::PORTRAIT) { - $imageWidth = self::IMAGE_GRAPH_WIDTH_PORTRAIT; - $imageHeight = self::IMAGE_GRAPH_HEIGHT_PORTRAIT; - } else { - $imageWidth = self::IMAGE_GRAPH_WIDTH_LANDSCAPE; - $imageHeight = self::IMAGE_GRAPH_HEIGHT_LANDSCAPE; - - // evolution graphs in landscape are better looking if they have the same height as in portrait - if(empty($this->reportMetadata['dimension']) || ($this->evolutionGraph && !empty($this->reportMetadata['imageGraphEvolutionUrl']))) - { - $imageHeight = self::IMAGE_GRAPH_HEIGHT_PORTRAIT; - } - } - - $imageGraph = parent::getStaticGraph($this->reportMetadata, $imageWidth, $imageHeight, $this->evolutionGraph); + $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->TCPDF->Image( '@'.$imageGraph, |