summaryrefslogtreecommitdiffstats
path: root/src/options/chart.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-06-12 16:29:14 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-06-12 16:29:14 +0000
commit4c71c431a983f0c1216981e2011e823d303848d7 (patch)
tree8fb31999ca1fb711e54c2eb8519f59116d9f05b6 /src/options/chart.php
parent3f1b5624719e557f8c4f7cb49f57d92fe3b37b4d (diff)
downloadzetacomponents-graph-4c71c431a983f0c1216981e2011e823d303848d7.zip
zetacomponents-graph-4c71c431a983f0c1216981e2011e823d303848d7.tar.gz
- Added tests and implementation for background images in charts
- Fixed bug with image sizes in gd driver
Diffstat (limited to 'src/options/chart.php')
-rw-r--r--src/options/chart.php24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/options/chart.php b/src/options/chart.php
index ada1f77..ccbb6c0 100644
--- a/src/options/chart.php
+++ b/src/options/chart.php
@@ -75,6 +75,9 @@ class ezcGraphChartOptions extends ezcBaseOptions
{
$this->font = new ezcGraphFontOptions();
+ $this->backgroundImage = new ezcGraphChartElementBackgroundImage();
+ $this->backgroundImage->position = ezcGraph::CENTER | ezcGraph::MIDDLE;
+
parent::__construct( $options );
}
@@ -101,26 +104,7 @@ class ezcGraphChartOptions extends ezcBaseOptions
$this->padding = max( 0, (int) $propertyValue );
break;
case 'backgroundImage':
- // Check for existance of file
- if ( !is_file( $propertyValue ) || !is_readable( $propertyValue ) )
- {
- throw new ezcBaseFileNotFoundException( $propertyValue );
- }
-
- // Check for beeing an image file
- $data = getImageSize( $propertyValue );
- if ( $data === false )
- {
- throw new ezcGraphInvalidImageFileException( $propertyValue );
- }
-
- // SWF files are useless..
- if ( $data[2] === 4 )
- {
- throw new ezcGraphInvalidImageFileException( 'We cant use SWF files like <' . $propertyValue . '>.' );
- }
-
- $this->backgroundImage = $propertyValue;
+ $this->backgroundImage->source = $propertyValue;
break;
case 'background':
$this->background = ezcGraphColor::create( $propertyValue );
OpenPOWER on IntegriCloud