diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-09-19 13:29:02 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-09-19 13:29:02 +0000 |
commit | fe13be6dac3b9a019cd4ee7a4e1b3272ef922871 (patch) | |
tree | 3ac7e934fb907911583e4bd4c48aec7dc12bde95 /src/options/line_chart.php | |
parent | 27cffe45cdf9cc6d36751bcc998459ae9d8a1f4b (diff) | |
download | zetacomponents-graph-fe13be6dac3b9a019cd4ee7a4e1b3272ef922871.zip zetacomponents-graph-fe13be6dac3b9a019cd4ee7a4e1b3272ef922871.tar.gz |
- Added background and border to font configuration
- Show value for highlighted datapoints in bar and line charts
Diffstat (limited to 'src/options/line_chart.php')
-rw-r--r-- | src/options/line_chart.php | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/src/options/line_chart.php b/src/options/line_chart.php index 358f82a..c8eadb5 100644 --- a/src/options/line_chart.php +++ b/src/options/line_chart.php @@ -18,6 +18,13 @@ * - (int) Opacity used to fill up the space with the lines color. * @property int $symbolSize * Size of symbols in line chart. + * @property ezcGraphFontOptions $highlightFont + * Font configuration for highlight tests + * @property int $highlightSize + * Size of highlight blocks + * @property bool $highlightLines + * If true, it adds lines to highlight the values position on the + * axis. * * @package Graph */ @@ -35,7 +42,11 @@ class ezcGraphLineChartOptions extends ezcGraphChartOptions $this->properties['lineThickness'] = 2; $this->properties['fillLines'] = false; $this->properties['symbolSize'] = 8; - + $this->properties['highlightFont'] = new ezcGraphFontOptions(); + $this->properties['highlightFontCloned'] = false; + $this->properties['highlightSize'] = 14; + $this->properties['highlightLines'] = false; + parent::__construct( $options ); } @@ -68,10 +79,62 @@ class ezcGraphLineChartOptions extends ezcGraphChartOptions case 'symbolSize': $this->properties['symbolSize'] = max( 1, (int) $propertyValue ); break; + case 'highlightFont': + if ( $propertyValue instanceof ezcGraphFontOptions ) + { + $this->properties['highlightFont'] = $propertyValue; + } + elseif ( is_string( $propertyValue ) ) + { + if ( !$this->properties['highlightFontCloned'] ) + { + $this->properties['highlightFont'] = clone $this->font; + $this->properties['highlightFontCloned'] = true; + } + + $this->properties['highlightFont']->font = $propertyValue; + } + else + { + throw new ezcBaseValueException( $propertyValue, 'ezcGraphFontOptions' ); + } + break; + case 'highlightSize': + $this->properties['highlightSize'] = max( 1, (int) $propertyValue ); + break; + case 'highlightLines': + $this->properties['highlightLines'] = (bool) $propertyValue; + break; default: return parent::__set( $propertyName, $propertyValue ); } } + + /** + * __get + * + * @param mixed $propertyName + * @throws ezcBasePropertyNotFoundException + * If a the value for the property options is not an instance of + * @return mixed + * @ignore + */ + public function __get( $propertyName ) + { + switch ( $propertyName ) + { + case 'highlightFont': + // Clone font configuration when requested for this element + if ( !$this->properties['highlightFontCloned'] ) + { + $this->properties['highlightFont'] = clone $this->properties['font']; + $this->properties['highlightFontCloned'] = true; + } + return $this->properties['highlightFont']; + default: + return parent::__get( $propertyName ); + } + } } ?> |