diff options
author | Thomas ZILLIOX <thomas@zilliox.me> | 2013-08-05 21:07:53 +0400 |
---|---|---|
committer | Thomas ZILLIOX <thomas@zilliox.me> | 2013-08-05 21:07:53 +0400 |
commit | b56ce034374aaf72807ba1e625be5c97fd2df1c8 (patch) | |
tree | 5119ff588c1e3bb9b13d131b6f4175a4893426b1 /libs | |
parent | 83c1936bd27aef1e23c8c6db106fdabe62e66559 (diff) |
Theme the sparklines, graph & transitions
Diffstat (limited to 'libs')
-rw-r--r-- | libs/sparkline/lib/Sparkline.php | 13 | ||||
-rw-r--r-- | libs/sparkline/lib/Sparkline_Line.php | 6 |
2 files changed, 7 insertions, 12 deletions
diff --git a/libs/sparkline/lib/Sparkline.php b/libs/sparkline/lib/Sparkline.php index eed708aaae..f9dc98bc6c 100644 --- a/libs/sparkline/lib/Sparkline.php +++ b/libs/sparkline/lib/Sparkline.php @@ -69,15 +69,11 @@ class Sparkline extends Object { // $this->SetColorDefaults(); while (list($k, $v) = each($this->colorList)) { - $this->SetColorHandle($k, $this->DrawColorAllocate($k, $this->imageHandle)); + $this->SetColorHandle($k, $this->DrawColorAllocate($k)); } reset($this->colorList); - if ($this->IsError()) { - return false; - } else { - return true; - } + return !$this->IsError(); } //////////////////////////////////////////////////////////////////////////// @@ -95,9 +91,8 @@ class Sparkline extends Object { if (array_key_exists($name, $this->colorList)) { $this->colorList[$name]['handle'] = $handle; return true; - } else { - return false; } + return false; } function SetColorHex($name, $r, $g, $b) { @@ -117,6 +112,7 @@ class Sparkline extends Object { } function GetColor($name) { + $name = strtolower($name); if (array_key_exists($name, $this->colorList)) { return $this->colorList[$name]['rgb']; } else { @@ -229,7 +225,6 @@ class Sparkline extends Object { function DrawColorAllocate($color, $handle = false) { $this->Debug("Sparkline :: DrawColorAllocate('$color')", DEBUG_DRAW); - if (!$this->IsError() && $colorRGB = $this->GetColor($color)) { if ($handle === false) $handle = $this->imageHandle; diff --git a/libs/sparkline/lib/Sparkline_Line.php b/libs/sparkline/lib/Sparkline_Line.php index 292b3b3ed8..59b5a2eff7 100644 --- a/libs/sparkline/lib/Sparkline_Line.php +++ b/libs/sparkline/lib/Sparkline_Line.php @@ -31,7 +31,7 @@ class Sparkline_Line extends Sparkline { $this->dataSeries = array(); $this->dataSeriesStats = array(); $this->dataSeriesConverted = array(); - + $this->colorBackground = 'backgroundColor'; $this->featurePoint = array(); } // function Sparkline @@ -167,7 +167,7 @@ class Sparkline_Line extends Sparkline { $this->dataSeriesConverted[1][$i][1] + $this->graphAreaPx[0][1], $this->dataSeriesConverted[1][$i+1][0] + $this->graphAreaPx[0][0], $this->dataSeriesConverted[1][$i+1][1] + $this->graphAreaPx[0][1], - 'black'); + 'lineColor'); } // draw features @@ -245,7 +245,7 @@ class Sparkline_Line extends Sparkline { $this->dataSeriesConverted[1][$i][1], $this->dataSeriesConverted[1][$i+1][0], $this->dataSeriesConverted[1][$i+1][1], - 'black', + 'lineColor', $this->GetLineSize(), $imageVCHandle); } |