diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-08-14 12:50:28 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-08-14 12:50:28 +0000 |
commit | 48155e33dd6901e3966d9b151d837bcbdc8e9968 (patch) | |
tree | 04fbae229bbf0a5bbea14d3e4da3f0bd976a4572 /src/datasets/array.php | |
parent | 21f7809f953a75b9e6214d0549a7f1941e3df7b9 (diff) | |
download | zetacomponents-graph-48155e33dd6901e3966d9b151d837bcbdc8e9968.zip zetacomponents-graph-48155e33dd6901e3966d9b151d837bcbdc8e9968.tar.gz |
- Changed datsets to accept instances of ezcGraphDataSet only
- Added bar charts
- Globally increase acceptable difference noise for created images in tests
Diffstat (limited to 'src/datasets/array.php')
-rw-r--r-- | src/datasets/array.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/datasets/array.php b/src/datasets/array.php new file mode 100644 index 0000000..44aa82c --- /dev/null +++ b/src/datasets/array.php @@ -0,0 +1,42 @@ +<?php +/** + * File containing the abstract ezcGraphArrayDataSet class + * + * @package Graph + * @version //autogentag// + * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * Basic class to contain the charts data + * + * @package Graph + */ +class ezcGraphArrayDataSet extends ezcGraphDataSet +{ + public function __construct( $data ) + { + $this->createFromArray( $data ); + parent::__construct(); + } + + /** + * setData + * + * @param array $data + * @access public + * @return void + */ + protected function createFromArray( $data = array() ) + { + foreach ( $data as $key => $value ) + { + if ( is_numeric( $value ) ) + { + $this->data[$key] = (float) $value; + } + } + } +} + +?> |