summaryrefslogtreecommitdiffstats
path: root/src/driver/svg.php
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/driver/svg.php
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/driver/svg.php')
-rw-r--r--src/driver/svg.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/driver/svg.php b/src/driver/svg.php
index bfbf95c..81e2aed 100644
--- a/src/driver/svg.php
+++ b/src/driver/svg.php
@@ -457,7 +457,15 @@ class ezcGraphSvgDriver extends ezcGraphDriver
if ( !is_array( $result ) )
{
- throw new ezcGraphFontRenderingException( $string, $this->options->font->minFontSize, $width, $height );
+ if ( ( $height >= $this->options->font->minFontSize ) &&
+ ( $this->options->autoShortenString ) )
+ {
+ $result = $this->tryFitShortenedString( $string, $position, $width, $height, $size = $this->options->font->minFontSize );
+ }
+ else
+ {
+ throw new ezcGraphFontRenderingException( $string, $this->options->font->minFontSize, $width, $height );
+ }
}
$this->options->font->minimalUsedFont = $size;
OpenPOWER on IntegriCloud