Beispiel #1
0
 /**
  * Constructor
  * 
  * @param ezcGraphDataSet $dataset Dataset to interpolate
  * @param int $order Maximum order of interpolating polynom
  * @return void
  * @ignore
  */
 public function __construct(ezcGraphDataSet $dataset, $order = 3)
 {
     parent::__construct();
     $this->properties['resolution'] = 100;
     $this->properties['polynomOrder'] = (int) $order;
     $this->source = $dataset;
 }
Beispiel #2
0
 /**
  * Constructor
  * 
  * @param float $start Start value for x axis values of function
  * @param float $end End value for x axis values of function
  * @param callback $callback Callback function
  * @return void
  * @ignore
  */
 public function __construct($start = null, $end = null, $callback = null)
 {
     parent::__construct();
     $this->properties['start'] = null;
     $this->properties['end'] = null;
     $this->properties['callback'] = null;
     if ($start !== null) {
         $this->start = $start;
     }
     if ($end !== null) {
         $this->end = $end;
     }
     if ($callback !== null) {
         $this->callback = $callback;
     }
     $this->properties['resolution'] = 100;
 }
Beispiel #3
0
 /**
  * Constructor
  * 
  * @param array|Iterator $data Array or Iterator containing the data
  * @return void
  */
 public function __construct($data)
 {
     $this->createFromArray($data);
     parent::__construct();
 }
Beispiel #4
0
 /**
  * Constructor
  * 
  * Creates a ezcGraphDatabase from a PDOStatement and uses the columns 
  * defined in the definition array as keys and values for the data set. 
  *
  * If the definition array is empty a single column will be used as values,
  * with two columns the first column will be used for the keys and the 
  * second for the data set values.
  *
  * You may define the name of the rows used for keys and values by using 
  * an array like:
  *  array (
  *      ezcGraph::KEY => 'row name',
  *      ezcGraph::VALUE => 'row name',
  *  );
  *
  * PDO by default lowercases all column names, see PDO::setAttribute() for
  * details. If the column names you pass to the dataset definition array
  * are not lowercase, you either need to change the PDO::ATTR_CASE
  * attribute of your PDO connection instance, or lowercase the names passed
  * to the definition array. Otherwise this will throw
  * ezcGraphDatabaseMissingColumnException exceptions.
  *
  * @param PDOStatement $statement
  * @param array $definition
  * @return ezcGraphDatabase
  */
 public function __construct(PDOStatement $statement, array $definition = null)
 {
     parent::__construct();
     $this->data = array();
     $this->createFromPdo($statement, $definition);
 }