summaryrefslogtreecommitdiffstats
path: root/src/interfaces
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-06-06 14:48:52 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-06-06 14:48:52 +0000
commit2643696538c5546f3d271829e07734883e134c3c (patch)
tree87b45e93a62affaf4736acfb8a420472db1ebe5b /src/interfaces
parent51bbe683d53acf187ebaca6af0e8dcf8dc2db6e7 (diff)
downloadzetacomponents-graph-2643696538c5546f3d271829e07734883e134c3c.zip
zetacomponents-graph-2643696538c5546f3d271829e07734883e134c3c.tar.gz
- Added gridColor option to palettes
- Differentiate between elements and charts background color
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/chart.php2
-rw-r--r--src/interfaces/element.php1
-rw-r--r--src/interfaces/palette.php35
3 files changed, 29 insertions, 9 deletions
diff --git a/src/interfaces/chart.php b/src/interfaces/chart.php
index de0aed4..209942d 100644
--- a/src/interfaces/chart.php
+++ b/src/interfaces/chart.php
@@ -162,7 +162,7 @@ abstract class ezcGraphChart
{
$this->options->font->font = $palette->fontFace;
$this->options->font->color = $palette->fontColor;
- $this->options->background = $palette->background;
+ $this->options->background = $palette->chartBackground;
$this->options->border = $palette->chartBorderColor;
$this->options->borderWidth = $palette->chartBorderWidth;
diff --git a/src/interfaces/element.php b/src/interfaces/element.php
index d42e124..62318ad 100644
--- a/src/interfaces/element.php
+++ b/src/interfaces/element.php
@@ -128,6 +128,7 @@ abstract class ezcGraphChartElement extends ezcBaseOptions
{
$this->border = $palette->elementBorderColor;
$this->borderWidth = $palette->elementBorderWidth;
+ $this->background = $palette->elementBackground;
$this->padding = $palette->padding;
$this->margin = $palette->margin;
}
diff --git a/src/interfaces/palette.php b/src/interfaces/palette.php
index e1b07fe..ed924f3 100644
--- a/src/interfaces/palette.php
+++ b/src/interfaces/palette.php
@@ -29,18 +29,18 @@ abstract class ezcGraphPalette
protected $symbolIndex = -1;
/**
- * Backgroundcolor
+ * Axiscolor
*
* @var ezcGraphColor
*/
- protected $background;
+ protected $axisColor;
/**
- * Axiscolor
+ * Color of grid
*
* @var ezcGraphColor
*/
- protected $axisColor;
+ protected $gridColor;
/**
* Array with colors for datasets
@@ -71,6 +71,13 @@ abstract class ezcGraphPalette
protected $fontColor;
/**
+ * Backgroundcolor
+ *
+ * @var ezcGraphColor
+ */
+ protected $chartBackground;
+
+ /**
* Bordercolor the chart
*
* @var ezcGraphColor
@@ -86,6 +93,13 @@ abstract class ezcGraphPalette
protected $chartBorderWidth = 1;
/**
+ * Backgroundcolor for elements
+ *
+ * @var ezcGraphColor
+ */
+ protected $elementBackground;
+
+ /**
* Bordercolor for elements
*
* @var ezcGraphColor
@@ -122,7 +136,11 @@ abstract class ezcGraphPalette
*/
protected function checkColor( &$color )
{
- if ( !( $color instanceof ezcGraphColor ) )
+ if ( $color == NULL )
+ {
+ return ezcGraphColor::fromHex( '#000000FF' );
+ }
+ elseif ( !( $color instanceof ezcGraphColor ) )
{
$color = ezcGraphColor::create( $color );
}
@@ -140,9 +158,6 @@ abstract class ezcGraphPalette
{
switch ( $propertyName )
{
- case 'background':
- return $this->checkColor( $this->background );
-
case 'axisColor':
return $this->checkColor( $this->axisColor );
@@ -158,11 +173,15 @@ abstract class ezcGraphPalette
case 'fontFace':
return $this->fontFace;
+ case 'chartBackground':
+ return $this->checkColor( $this->chartBackground );
case 'chartBorderColor':
return $this->checkColor( $this->chartBorderColor );
case 'chartBorderWidth':
return $this->chartBorderWidth;
+ case 'elementBackground':
+ return $this->checkColor( $this->elementBackground );
case 'elementBorderColor':
return $this->checkColor( $this->elementBorderColor );
case 'elementBorderWidth':
OpenPOWER on IntegriCloud