summaryrefslogtreecommitdiffstats
path: root/src/datasets
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-06-12 12:13:32 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-06-12 12:13:32 +0000
commit860aac17b96f6a8335b14bd97db51c8d80a6a09c (patch)
tree5f353430f16d5cc7b82d53380f8c397bf369d3c2 /src/datasets
parent378316b058f3d1fbe1662d102e6dc08124be8780 (diff)
downloadzetacomponents-graph-860aac17b96f6a8335b14bd97db51c8d80a6a09c.zip
zetacomponents-graph-860aac17b96f6a8335b14bd97db51c8d80a6a09c.tar.gz
- Added possibility to highlight datasets and dataset elements
Diffstat (limited to 'src/datasets')
-rw-r--r--src/datasets/base.php46
-rw-r--r--src/datasets/property/boolean.php30
2 files changed, 76 insertions, 0 deletions
diff --git a/src/datasets/base.php b/src/datasets/base.php
index 6bd8cf3..b3c76c1 100644
--- a/src/datasets/base.php
+++ b/src/datasets/base.php
@@ -15,16 +15,55 @@
class ezcGraphDataset implements ArrayAccess, Iterator
{
+ /**
+ * labels for dataset and dataset elements
+ *
+ * @var ezcGraphDatasetStringProperty
+ */
protected $label;
+ /**
+ * Colors for dataset elements
+ *
+ * @var ezcGraphDatasetColorProperty
+ */
protected $color;
+ /**
+ * Symbols for dataset elements
+ *
+ * @var ezcGraphDatasetIntProperty
+ */
protected $symbol;
+ /**
+ * Status if dataset element is hilighted
+ *
+ * @var ezcGraphDatasetBooleanProperty
+ * @access protected
+ */
+ protected $highlight;
+
+ /**
+ * Array which contains the data of the dataset
+ *
+ * @var array
+ */
protected $data;
+ /**
+ * Current dataset element
+ * needed for iteration over dataset with ArrayAccess
+ *
+ * @var mixed
+ */
protected $current;
+ /**
+ * Color palette used for dataset colorization
+ *
+ * @var ezcGraphPalette
+ */
protected $pallet;
public function __construct()
@@ -32,6 +71,9 @@ class ezcGraphDataset implements ArrayAccess, Iterator
$this->label = new ezcGraphDatasetStringProperty( $this );
$this->color = new ezcGraphDatasetColorProperty( $this );
$this->symbol = new ezcGraphDatasetIntProperty( $this );
+ $this->highlight = new ezcGraphDatasetBooleanProperty( $this );
+
+ $this->highlight->default = false;
}
/**
@@ -65,6 +107,10 @@ class ezcGraphDataset implements ArrayAccess, Iterator
case 'symbol':
$this->symbol->default = $propertyValue;
break;
+ case 'highlight':
+ case 'hilight':
+ $this->highlight->default = $propertyValue;
+ break;
case 'palette':
$this->palette = $propertyValue;
$this->color->default = $this->palette->dataSetColor;
diff --git a/src/datasets/property/boolean.php b/src/datasets/property/boolean.php
new file mode 100644
index 0000000..318910d
--- /dev/null
+++ b/src/datasets/property/boolean.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * File containing the abstract ezcGraphDatasetBooleanProperty 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
+ */
+/**
+ * Class for integer properties of datasets
+ *
+ * @package Graph
+ */
+class ezcGraphDatasetBooleanProperty extends ezcGraphDatasetProperty
+{
+ /**
+ * Converts value to an ezcGraphColor object
+ *
+ * @param & $value
+ * @return void
+ */
+ protected function checkValue( &$value )
+ {
+ $value = (bool) $value;
+ return true;
+ }
+}
+
+?>
OpenPOWER on IntegriCloud