summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-08-08 12:09:04 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-08-08 12:09:04 +0000
commit5e6c1783d9ecbbf9ae8b1e0ff8c39c0d1fb91ffa (patch)
tree9a45ec6f551ba54c08266469df433f1de92069ef /src
parent950007a0594912ad27b923ef1ff54c533af654d9 (diff)
downloadzetacomponents-graph-5e6c1783d9ecbbf9ae8b1e0ff8c39c0d1fb91ffa.zip
zetacomponents-graph-5e6c1783d9ecbbf9ae8b1e0ff8c39c0d1fb91ffa.tar.gz
- Fixed calculation of title boundings to respect margin of title element
- Made ezcGraphChartElementText::maxHeight accessible
Diffstat (limited to 'src')
-rw-r--r--src/element/text.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/element/text.php b/src/element/text.php
index e08b482..dfe1a55 100644
--- a/src/element/text.php
+++ b/src/element/text.php
@@ -23,6 +23,30 @@ class ezcGraphChartElementText extends ezcGraphChartElement
protected $maxHeight = .1;
/**
+ * __set
+ *
+ * @param mixed $propertyName
+ * @param mixed $propertyValue
+ * @throws ezcBaseValueException
+ * If a submitted parameter was out of range or type.
+ * @throws ezcBasePropertyNotFoundException
+ * If a the value for the property options is not an instance of
+ * @return void
+ */
+ public function __set( $propertyName, $propertyValue )
+ {
+ switch ( $propertyName )
+ {
+ case 'maxHeight':
+ $this->maxHeight = min( 1, max( 0, (float) $propertyValue ) );
+ break;
+ default:
+ parent::__set( $propertyName, $propertyValue );
+ break;
+ }
+ }
+
+ /**
* Render a legend
*
* @param ezcGraphRenderer $renderer
@@ -39,7 +63,7 @@ class ezcGraphChartElementText extends ezcGraphChartElement
$height = (int) min(
round( $this->maxHeight * ( $boundings->y1 - $boundings->y0 ) ),
- $this->font->maxFontSize + $this->padding * 2
+ $this->font->maxFontSize + $this->padding * 2 + $this->margin * 2
);
switch ( $this->position )
OpenPOWER on IntegriCloud