summaryrefslogtreecommitdiffstats
path: root/src/datasets
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-12-13 11:10:53 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-12-13 11:10:53 +0000
commitab61c80e08eba3477e8918d3357d37f9d104fc0c (patch)
treedd71bc6c02aba37257de3001e504b2e41b990777 /src/datasets
parent5c274a550bf732ff5ffaf59db0d4a5f7b86a521e (diff)
downloadzetacomponents-graph-ab61c80e08eba3477e8918d3357d37f9d104fc0c.zip
zetacomponents-graph-ab61c80e08eba3477e8918d3357d37f9d104fc0c.tar.gz
- Fixed: Bug #9795 (Interferring bars, when bars count is higher then major
step count)
Diffstat (limited to 'src/datasets')
-rw-r--r--src/datasets/array.php10
-rw-r--r--src/datasets/average.php10
-rw-r--r--src/datasets/base.php2
3 files changed, 21 insertions, 1 deletions
diff --git a/src/datasets/array.php b/src/datasets/array.php
index 8eaf921..e28a761 100644
--- a/src/datasets/array.php
+++ b/src/datasets/array.php
@@ -42,6 +42,16 @@ class ezcGraphArrayDataSet extends ezcGraphDataSet
$this->data[$key] = $value;
}
}
+
+ /**
+ * Returns the number of elements in this dataset
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return count( $this->data );
+ }
}
?>
diff --git a/src/datasets/average.php b/src/datasets/average.php
index 0436ca0..96e790a 100644
--- a/src/datasets/average.php
+++ b/src/datasets/average.php
@@ -341,5 +341,15 @@ class ezcGraphDataSetAveragePolynom extends ezcGraphDataSet
{
$this->position = 0;
}
+
+ /**
+ * Returns the number of elements in this dataset
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return $this->resolution;
+ }
}
?>
diff --git a/src/datasets/base.php b/src/datasets/base.php
index 8a41818..7a3a089 100644
--- a/src/datasets/base.php
+++ b/src/datasets/base.php
@@ -14,7 +14,7 @@
* @package Graph
* @access private
*/
-abstract class ezcGraphDataSet implements ArrayAccess, Iterator
+abstract class ezcGraphDataSet implements ArrayAccess, Iterator, Countable
{
/**
OpenPOWER on IntegriCloud