properties['width'] = null; $this->properties['height'] = null; $this->properties['lineSpacing'] = .1; $this->properties['shadeCircularArc'] = .5; $this->properties['font'] = new ezcGraphFontOptions(); $this->properties['font']->color = ezcGraphColor::fromHex( '#000000' ); parent::__construct( $options ); } /** * Set an option value * * @param string $propertyName * @param mixed $propertyValue * @throws ezcBasePropertyNotFoundException * If a property is not defined in this class * @return void */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'width': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['width'] = (int) $propertyValue; break; case 'height': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'int >= 1' ); } $this->properties['height'] = (int) $propertyValue; break; case 'lineSpacing': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['lineSpacing'] = (float) $propertyValue; break; case 'shadeCircularArc': if ( !is_numeric( $propertyValue ) || ( $propertyValue < 0 ) || ( $propertyValue > 1 ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, '0 <= float <= 1' ); } $this->properties['shadeCircularArc'] = (float) $propertyValue; break; case 'font': if ( $propertyValue instanceof ezcGraphFontOptions ) { $this->properties['font'] = $propertyValue; } else { throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphFontOptions' ); } break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); break; } } } ?>