# GoogleChartAxis.class.php

Go to the documentation of this file.

    00001 <?php
    00002 /***************************************************************************
    00003  *   Copyright (C) 2008-2009 by Denis M. Gabaidulin                        *
    00004  *                                                                         *
    00005  *   This program is free software; you can redistribute it and/or modify  *
    00006  *   it under the terms of the GNU Lesser General Public License as        *
    00007  *   published by the Free Software Foundation; either version 3 of the    *
    00008  *   License, or (at your option) any later version.                       *
    00009  *                                                                         *
    00010  ***************************************************************************/
    00011
    00015     final class GoogleChartAxis
    00016     {
    00017         private $type = null;
    00018
    00019         private $range = null;
    00020
    00021         private $label = null;
    00022
    00023         private $interval = null;
    00024
    00028         public static function create(GoogleChartAxisType $type)
    00029         {
    00030             return new self($type);
    00031         }
    00032
    00033         public function __construct(GoogleChartAxisType $type)
    00034         {
    00035             $this->type = $type;
    00036         }
    00037
    00041         public function getType()
    00042         {
    00043             return $this->type;
    00044         }
    00045
    00049         public function setRange(BaseRange $range)
    00050         {
    00051             $this->range = $range;
    00052
    00053             return $this;
    00054         }
    00055
    00056         public function hasRange()
    00057         {
    00058             return ($this->range !== null);
    00059         }
    00060
    00064         public function getRange()
    00065         {
    00066             return $this->range;
    00067         }
    00068
    00072         public function setLabel(GoogleChartAxisLabel $label)
    00073         {
    00074             $this->label = $label;
    00075
    00076             return $this;
    00077         }
    00078
    00082         public function getLabel()
    00083         {
    00084             return $this->label;
    00085         }
    00086
    00090         public function setInterval($interval)
    00091         {
    00092             Assert::isTrue(is_numeric($interval));
    00093
    00094             $this->interval = $interval;
    00095
    00096             return $this;
    00097         }
    00098
    00099         public function getInterval()
    00100         {
    00101             return $this->interval;
    00102         }
    00103     }
    00104 ?>