TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Source for file DefaultTheme.php

Documentation is available at DefaultTheme.php

  1. <?php
  2.  
  3. /**
  4.  * DefaultTheme class
  5.  *
  6.  * Description: Summary description for DefaultTheme
  7.  *
  8.  * @author
  9.  * @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
  10.  * @version 1.0
  11.  * @package TeeChartPHP
  12.  * @subpackage themes
  13.  * @link http://www.steema.com
  14.  */
  15.  
  16.  class DefaultTheme extends Theme {
  17.  
  18.     public function DefaultTheme($c{
  19.         parent::Theme($c);
  20.     }
  21.  
  22.     public function apply({
  23.         //$baseDir = dirname(__FILE__) . "/../";      
  24.        
  25.         $this->chart->getPanel()->getBevel()->setInner(BevelStyle::$NONE);
  26.         $this->chart->getPanel()->getBevel()->setOuter(BevelStyle::$RAISED);
  27.         $this->chart->getPanel()->getBevel()->setWidth(1);
  28.         $this->chart->getPanel()->getPen()->setVisible(false);
  29.         $this->chart->getPanel()->setBorderRound(0);
  30.  
  31.         $this->chart->getPanel()->getShadow()->setSize(0);      
  32.         $this->chart->getPanel()->setColor(Color::getSilver());
  33.  
  34.         $this->resetGradient($this->chart->getPanel()->getGradient());
  35.         $this->chart->getLegend()->getShadow()->setHeight(3);
  36.         $this->chart->getLegend()->getShadow()->setWidth(3);
  37.         $this->chart->getLegend()->getShadow()->setTransparency(0);        
  38.         //$this->chart->getLegend()->getFont()->setName($baseDir . ChartFont::$DEFAULTFAMILY);
  39.         //$this->chart->getLegend()->getFont()->setSize(ChartFont::$DEFAULTSIZE);
  40.         $this->chart->getLegend()->getSymbol()->setDefaultPen(true);
  41.         $this->chart->getLegend()->setTransparent(false);
  42.         $this->chart->getLegend()->getPen()->setVisible(true);
  43.         $this->chart->getLegend()->getDividingLines()->setVisible(false);
  44.         $this->chart->getLegend()->getGradient()->setVisible(false);
  45.  
  46.         $this->changeWall($this->chart->getWalls()->getLeft()new Color(255,255,128));
  47.         $this->changeWall($this->chart->getWalls()->getRight()Color::getSilver());
  48.         $this->changeWall($this->chart->getWalls()->getBack()Color::getSilver());
  49.         $this->changeWall($this->chart->getWalls()->getBottom()Color::getWhite());
  50.  
  51.         $this->chart->getWalls()->getBack()->setTransparent(true);
  52.  
  53.         for $t 0$t $this->chart->getAxes()->getCount()++$t{
  54.             $this->changeAxis($this->chart->getAxes()->getAxis($t));
  55.         }
  56.  
  57.         for $t 0$t $this->chart->getSeriesCount()++$t{
  58.             $this->changeSeries($this->chart->getSeries($t));
  59.         }
  60.                 
  61.         $this->chart->getPanel()->getGradient()->setStartColor(new Color(175,175,175));
  62.         $this->chart->getPanel()->getGradient()->setEndColor(new Color(255,255,255));
  63.         $this->chart->getPanel()->getGradient()->setVisible(true);
  64.         
  65.         ColorPalettes::applyPalette($this->chart0);
  66.     }
  67.  
  68.     /**
  69.       * Gets descriptive text.
  70.       *
  71.       * @return String 
  72.       */
  73.     public function getDescription({
  74.         return " default";
  75.     }
  76.  
  77.     public function resetGradient($chartGradient{
  78.         $chartGradient->setVisible(false);
  79.         $chartGradient->setStartColorColor::getWhite());
  80.         $chartGradient->setDirection('vertical');
  81.         $chartGradient->setEndColorColor::getYellow());
  82. //        $chartGradient->setMiddleColor( Color::getEmpty());
  83.     }
  84.  
  85.     public function changeWall($chartWall$aColor{
  86.         $chartWall->getPen()->setVisible(true);
  87.         $chartWall->getPen()->setColor(Color::getBlack());
  88.         $chartWall->getPen()->setWidth(1);
  89.         $chartWall->getPen()->setStyle(DashStyle::$SOLID);
  90.         $chartWall->getGradient()->setVisible(false);
  91.         $chartWall->setColor($aColor);
  92.         $chartWall->setApplyDark(true);
  93.         $chartWall->setSize(0);
  94.     }
  95.  
  96.     public function changeSeries($chartSeries{
  97.         $chartSeries->getMarks()->setTransparent(false);
  98.         $chartSeries->getMarks()->getGradient()->setVisible(false);
  99.         //$chartSeries->getMarks()->getFont()->setName($baseDir . ChartFont::$DEFAULTFAMILY);
  100.         $chartSeries->getMarks()->getFont()->setSize(8);
  101.         $chartSeries->getMarks()->getArrow()->setColor(Color::getWhite());
  102.     }
  103.  
  104.     public function changeAxis($chartAxis{
  105.         $chartAxis->getAxisPen()->setWidth(2);
  106.         $chartAxis->getAxisPen()->setColor(Color::getBlack());
  107.  
  108.         $chartAxis->getGrid()->setVisible(true);
  109.         $chartAxis->getGrid()->setColor(Color::getGray());
  110.         $chartAxis->getGrid()->setStyle(DashStyle::$DOT);
  111.         $chartAxis->getGrid()->setCentered(false);
  112.  
  113.         $chartAxis->getTicks()->setColor(Color::getDarkGray());
  114.         $chartAxis->getTicksInner()->setVisible(true);
  115.         $chartAxis->getMinorTicks()->setVisible(true);
  116.  
  117.         $chartAxis->getMinorGrid()->setVisible(false);
  118.         $chartAxis->setMinorTickCount(3);
  119.         $chartAxis->getMinorTicks()->setLength(2);
  120.         $chartAxis->getTicks()->setLength(2);
  121.         $chartAxis->getTicksInner()->setLength(0);
  122.  
  123.         //$f=$chartAxis->getLabels()->getFont();
  124.         //$f->setName($baseDir . ChartFont::$DEFAULTFAMILY);
  125.         //$f->setSize(8);
  126.         //$f->setColor(Color::getBlack());
  127.  
  128.         //$chartAxis->getTitle()->getFont()->setName($baseDir . ChartFont::$DEFAULTFAMILY);
  129.     }
  130. }
  131. ?>

Documentation generated on Wed, 16 Jun 2010 12:05:03 +0200 by phpDocumentor 1.4.1