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

Source for file ExcelTheme.php

Documentation is available at ExcelTheme.php

  1. <?php
  2.  
  3. /**
  4.   *
  5.   * <p>Title: ExcelTheme class</p>
  6.   *
  7.   * <p>Description: Summary description for ExcelTheme.</p>
  8.   *
  9.   * <p>Copyright (c) 2005-2007 by Steema Software SL. All Rights Reserved.</p>
  10.   *
  11.   * <p>Company: Steema Software SL</p>
  12.   *
  13.   */
  14.   
  15.  class ExcelTheme extends DefaultTheme {
  16.  
  17.     public function ExcelTheme($c{
  18.         parent::DefaultTheme($c);
  19.     }
  20.  
  21.     /**
  22.     * Gets descriptive text.
  23.     *
  24.     * @return String 
  25.     */
  26.     public function getDescription({
  27.         return " Excel";
  28.     }
  29.  
  30.     /**
  31.     * Applies Excel-like visual formatting properties to Chart parameter.
  32.     */
  33.     public function apply({
  34.         parent::apply();
  35.         
  36.         $this->chart->getPanel()->getBevel()->setInner(BevelStyle::$NONE);
  37.         $this->chart->getPanel()->getBevel()->setOuter(BevelStyle::$NONE);
  38.         $this->chart->getPanel()->setBorderRound(0);
  39.         $this->chart->getPanel()->getPen()->setVisible(true);
  40.         $this->chart->getPanel()->getPen()->setWidth(1);
  41.         $this->chart->getPanel()->getPen()->setStyle(DashStyle::$SOLID);
  42.         $this->chart->getPanel()->getPen()->setColor(Color::BLACK());
  43.  
  44.         $this->chart->getPanel()->setColor(Color::WHITE());
  45.         $this->chart->getPanel()->getGradient()->setVisible(false);
  46.  
  47.         $this->chart->getLegend()->getShadow()->setHeight(0);
  48.         $this->chart->getLegend()->getShadow()->setWidth(0);
  49.         $this->chart->getLegend()->getDividingLines()->setVisible(false);
  50.         //$this->chart->getLegend()->getFont()->setName("Arial");
  51.         $this->chart->getLegend()->getFont()->setSize(10);
  52.         $this->chart->getLegend()->getPen()->setColor(Color::BLACK());
  53.         $this->chart->getLegend()->getPen()->setWidth(1);
  54.         $this->chart->getLegend()->getPen()->setStyle(DashStyle::$SOLID);
  55.         $this->chart->getLegend()->getPen()->setVisible(true);             
  56.         $this->chart->getLegend()->setTransparent(false);
  57.         $this->chart->getLegend()->getGradient()->setVisible(false);
  58.  
  59.         $this->doChangeWall($this->chart->getWalls()->getLeft()Color::SILVER());
  60.         $this->doChangeWall($this->chart->getWalls()->getRight()Color::SILVER());
  61.         $this->doChangeWall($this->chart->getWalls()->getBack()Color::SILVER());
  62.         $this->doChangeWall($this->chart->getWalls()->getBottom()Color::DARK_GRAY());
  63.  
  64.         $this->chart->getWalls()->getBack()->setTransparent(false);
  65.  
  66.         for $t 0$t $this->chart->getAxes()->getCount()++$t{
  67.             $this->doChangeAxis($this->chart->getAxes()->getAxis($t));
  68.         }
  69.  
  70.         $this->chart->getAxes()->getTop()->getGrid()->setVisible(false);
  71.         $this->chart->getAxes()->getBottom()->getGrid()->setVisible(false);
  72.         $this->chart->getAxes()->getBottom()->getGrid()->setCentered(true);
  73.  
  74.         for $t 0$t $this->chart->getSeriesCount()++$t{
  75.             $this->doChangeSeries($this->chart->getSeries($t));
  76.         }
  77.  
  78.         //$this->chart->getHeader()->getFont()->setName("Arial");
  79.         $this->chart->getHeader()->getFont()->setSize(10);
  80.         $this->chart->getHeader()->getFont()->setColor(Color::BLACK());
  81.  
  82.         ColorPalettes::applyPalette($this->chart2);
  83.     }
  84.  
  85.     private function doChangeWall($chartWall$aColor{
  86.         $chartWall->getPen()->setVisible(true);
  87.         $chartWall->getPen()->setColor(Color::DARK_GRAY());
  88.         $chartWall->getPen()->setWidth(1);
  89.         $chartWall->getPen()->setStyle(DashStyle::$SOLID);
  90.         $chartWall->getGradient()->setVisible(false);
  91.         $chartWall->setColor($aColor);
  92.         $chartWall->setApplyDark(false);
  93.     }
  94.  
  95.     private function doChangeAxis($chartAxis{
  96.         $chartAxis->getGrid()->setWidth(1);
  97.         $chartAxis->getGrid()->setVisible(true);
  98.         $chartAxis->getGrid()->setColor(Color::BLACK());
  99.         $chartAxis->getGrid()->setStyle(DashStyle::$SOLID);
  100.         $chartAxis->getGrid()->setCentered(false);
  101.  
  102.         $chartAxis->getTicks()->setColor(Color::BLACK());
  103.  
  104.         $chartAxis->getMinorTicks()->setVisible(false);
  105.         $chartAxis->getTicksInner()->setVisible(false);
  106.  
  107.         //$chartAxis->getLabels()->getFont()->setName("Arial");
  108.         $chartAxis->getLabels()->getFont()->setSize(10);
  109.     }
  110.  
  111.     private function doChangeSeries($chartSeries{
  112.         $chartSeries->getMarks()->getGradient()->setVisible(false);
  113.         $chartSeries->getMarks()->setTransparent(true);
  114.         //$chartSeries->getMarks()->getFont()->setName("Arial");
  115.         $chartSeries->getMarks()->getFont()->setSize(10);
  116.         $chartSeries->getMarks()->getArrow()->setColor(Color::WHITE());        
  117.     }
  118. }
  119. ?>

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