summaryrefslogtreecommitdiffstats
path: root/src/options
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-05-29 07:31:41 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-05-29 07:31:41 +0000
commite9f7f66fef8d66865eae4cf731bf502c19dc948e (patch)
tree90b2ae3b143e4e3139c71f42c5cdee9a2779331b /src/options
parentcc7669f009a394d3ac90f8aef489438fbccd3e9c (diff)
downloadzetacomponents-graph-e9f7f66fef8d66865eae4cf731bf502c19dc948e.zip
zetacomponents-graph-e9f7f66fef8d66865eae4cf731bf502c19dc948e.tar.gz
- Fixed issue #10830: Automatically shorten labels if not enough space is
available
Diffstat (limited to 'src/options')
-rw-r--r--src/options/driver.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/options/driver.php b/src/options/driver.php
index eb353af..b967192 100644
--- a/src/options/driver.php
+++ b/src/options/driver.php
@@ -20,6 +20,10 @@
* Percent of font size used for line spacing
* @property int $font
* Font used in the graph.
+ * @property bool $autoShortenString
+ * Automatically shorten string if it does not fit into a box
+ * @property string $autoShortenStringPostFix
+ * String to append to shortened strings, if there is enough space
*
* @package Graph
*/
@@ -42,6 +46,9 @@ abstract class ezcGraphDriverOptions extends ezcBaseOptions
$this->properties['font'] = new ezcGraphFontOptions();
$this->properties['font']->color = ezcGraphColor::fromHex( '#000000' );
+ $this->properties['autoShortenString'] = true;
+ $this->properties['autoShortenStringPostFix'] = '..';
+
parent::__construct( $options );
}
@@ -106,6 +113,19 @@ abstract class ezcGraphDriverOptions extends ezcBaseOptions
throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphFontOptions' );
}
break;
+ case 'autoShortenString':
+ if ( is_bool( $propertyValue ) )
+ {
+ $this->properties['autoShortenString'] = $propertyValue;
+ }
+ else
+ {
+ throw new ezcBaseValueException( $propertyName, $propertyValue, 'boolean' );
+ }
+ break;
+ case 'autoShortenStringPostFix':
+ $this->properties['autoShortenStringPostFix'] = (string) $propertyValue;
+ break;
default:
throw new ezcBasePropertyNotFoundException( $propertyName );
break;
OpenPOWER on IntegriCloud