diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-08-18 10:09:06 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-08-18 10:09:06 +0000 |
commit | 94953ea4f75810e5e667425bfd55ce8d51672ee3 (patch) | |
tree | b6e34c66f1031c2834c3578a7e80382710c2f362 /src/datasets | |
parent | e981be4dca177e235f6aa9b597d4a99c0a2cf875 (diff) | |
download | zetacomponents-graph-94953ea4f75810e5e667425bfd55ce8d51672ee3.zip zetacomponents-graph-94953ea4f75810e5e667425bfd55ce8d51672ee3.tar.gz |
- Moved properties to properties array
- Fixed bug: Legend title was rendered, even when empty
Diffstat (limited to 'src/datasets')
-rw-r--r-- | src/datasets/array.php | 7 | ||||
-rw-r--r-- | src/datasets/average.php | 22 |
2 files changed, 24 insertions, 5 deletions
diff --git a/src/datasets/array.php b/src/datasets/array.php index 44aa82c..1d28aa0 100644 --- a/src/datasets/array.php +++ b/src/datasets/array.php @@ -14,6 +14,13 @@ */ class ezcGraphArrayDataSet extends ezcGraphDataSet { + /** + * Constructor + * + * @param array $options Default option array + * @return void + * @ignore + */ public function __construct( $data ) { $this->createFromArray( $data ); diff --git a/src/datasets/average.php b/src/datasets/average.php index a964f57..2cc7f2e 100644 --- a/src/datasets/average.php +++ b/src/datasets/average.php @@ -11,20 +11,32 @@ * Extension of basic dataset to represent averation. * Algorithm: http://en.wikipedia.org/wiki/Least_squares * + * @property int $polynomOrder + * Maximum order of polygon to interpolate from points + * @property int $resolution + * Rsolution used to draw line in graph + * * @package Graph */ class ezcGraphDataSetAveragePolynom extends ezcGraphDataSet { - protected $polynomOrder = 3; protected $source; - protected $resolution = 5; - protected $polynom = false; + /** + * Constructor + * + * @param array $options Default option array + * @return void + * @ignore + */ public function __construct( ezcGraphDataSet $dataset ) { + $this->properties['resolution'] = 5; + $this->properties['polynomOrder'] = 3; + $this->source = $dataset; } @@ -43,7 +55,7 @@ class ezcGraphDataSetAveragePolynom extends ezcGraphDataSet { switch ( $propertyName ) { case 'polynomOrder': - $this->polynomOrder = (int) $propertyValue; + $this->properties['polynomOrder'] = (int) $propertyValue; $this->polynom = false; break; default: @@ -65,7 +77,7 @@ class ezcGraphDataSetAveragePolynom extends ezcGraphDataSet $a = new ezcGraphMatrix( count( $points ), $this->polynomOrder + 1 ); $b = new ezcGraphMatrix( count( $points ), 1 ); - for ( $i = 0; $i <= $this->polynomOrder; ++$i ) + for ( $i = 0; $i <= $this->properties['polynomOrder']; ++$i ) { foreach ( $points as $nr => $point ) { |