diff options
Diffstat (limited to 'libs/sparkline/lib/Sparkline.php')
-rw-r--r-- | libs/sparkline/lib/Sparkline.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/sparkline/lib/Sparkline.php b/libs/sparkline/lib/Sparkline.php index d748538c54..1641d7535d 100644 --- a/libs/sparkline/lib/Sparkline.php +++ b/libs/sparkline/lib/Sparkline.php @@ -60,8 +60,8 @@ class Sparkline extends Object { // $this->graphAreaPx = array(array($this->graphAreaPx[0][0], $this->graphAreaPx[0][1]), - array($this->graphAreaPx[1][0] + $x - 1, - $this->graphAreaPx[1][1] + $y - 1)); + array($this->graphAreaPx[1][0] + $x, //FIX FROM PIWIK + $this->graphAreaPx[1][1] + $y)); //FIX FROM PIWIK $this->imageHandle = $this->CreateImageHandle($x, $y); @@ -356,9 +356,12 @@ class Sparkline extends Object { } function DrawTextRelative($string, $x, $y, $color, $position, $padding = 2, $font = FONT_1, $handle = false) { + if(empty($string)) + { + return; + } $this->Debug("Sparkline :: DrawTextRelative('$string', $x, $y, '$color', $position, $font, $padding)", DEBUG_DRAW); - - if (!empty($string) && !$this->IsError() && + if (!$this->IsError() && $colorHandle = $this->GetColorHandle($color)) { if ($handle === false) $handle = $this->imageHandle; |