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

Source for file GrayscaleTheme.php

Documentation is available at GrayscaleTheme.php

  1. <?php
  2.  
  3. /**
  4.  * <p>Title: Grayscale Theme class</p>
  5.  *
  6.  * <p>Description: TeeChart for Java</p>
  7.  *
  8.  * <p>Copyright (c) 2004-2008 by Steema Software SL. All Rights Reserved.</p>
  9.  *
  10.  * <p>Company: Steema Software SL</p>
  11.  *
  12.  */
  13.  
  14.  class GrayscaleTheme extends DefaultTheme {
  15.  
  16.     /**
  17.      * Description of Classic theme
  18.      *
  19.      * @param IBaseChart
  20.      */
  21.     public function GrayscaleTheme($c{
  22.         parent::DefaultTheme($c);                  
  23.     }
  24.  
  25.     public function toString({
  26.         return Language::getString("GrayscaleTheme");
  27.     }
  28.  
  29.     public function apply({
  30.         parent::apply();
  31.  
  32.         $this->chart->getPanel()->getBevel()->setOuter(BevelStyle::$NONE);
  33.  
  34.         $this->chart->getPanel()->getPen()->setVisible(true);
  35.         $this->chart->getPanel()->getPen()->setColor(Color::WHITE());
  36.  
  37.         $this->chart->getLegend()->getShadow()->setSize(0);
  38.         $this->chart->getLegend()->getDividingLines()->setVisible(true);
  39.         $this->chart->getLegend()->getFont()->setSize(10);
  40.         $this->chart->getLegend()->setTransparent(true);
  41.  
  42.         $this->doChangeWall($this->chart->getWalls()->getLeft());
  43.         $this->doChangeWall($this->chart->getWalls()->getRight());
  44.         $this->doChangeWall($this->chart->getWalls()->getBack());
  45.         $this->doChangeWall($this->chart->getWalls()->getBottom());
  46.  
  47.         $this->chart->getWalls()->getBack()->setTransparent(false);
  48.         
  49.         for ($t 0$t $this->chart->getAxes()->getCount()++$t{
  50.             $this->doChangeAxis($this->chart->getAxes()->getAxis($t));
  51.         }
  52.              
  53.         for ($t 0$t $this->chart->getSeriesCount()++$t{
  54.             $this->doChangeSeries($this->chart->getSeries($t));
  55.         }
  56.         
  57.         $this->chart->getHeader()->getGradient()->setVisible(true);
  58.         $this->chart->getHeader()->getGradient()->setEndColor(Color::GRAY());
  59.  
  60.         $this->chart->getHeader()->getFont()->setSize(12);
  61.         $this->chart->getHeader()->getFont()->setColor(Color::BLACK());
  62.         
  63.         $this->chart->getHeader()->setColor(Color::WHITE());
  64.  
  65.     }
  66.  
  67.     private function doChangeWall($wall{
  68.         $wall->setColor(Color::WHITE());
  69.         $wall->setApplyDark(false);
  70.         $wall->setSize(0);
  71.     }
  72.  
  73.     private function doChangeAxis($axis{
  74.         $axis->getAxisPen()->setWidth(1);
  75.         
  76.         $axis->getGrid()->setColor(Color::BLACK());
  77.         $axis->getGrid()->setStyle(DashStyle::$SOLID);
  78.  
  79.         $axis->getMinorTicks()->setVisible(false);
  80.         $axis->getTicksInner()->setVisible(false);
  81.     }
  82.  
  83.  
  84.     private function doChangeSeries($series{
  85.         $series->getMarks()->setTransparent(true);
  86.         $series->getMarks()->getFont()->setSize(10);
  87.         $series->getMarks()->getArrow()->setColor(Color::BLACK());
  88.     }
  89. }
  90.  
  91. ?>

Documentation generated on Wed, 16 Jun 2010 12:06:02 +0200 by phpDocumentor 1.4.1