<?php
include ("jpgraph/src/jpgraph.php");
include ("jpgraph/src/jpgraph_bar.php");
//jpgraph facade pattern
class BarPlotter{
private $data;
private $graph;
private $posttime;
private $performance;
public function __construct($data){
$this->posttime = array();
$this->performance = array();
foreach($data as $key=>$value){
$this->posttime[] = $key;
$this->performance[] = $value;
$this->data[] = $value;
}
$this->graph = new Graph(400,300);
$this->graph->SetScale("textlin");
$bar1 = new BarPlot($this->data);
$bar1->value->Show();
$this->graph->Add($bar1);
}
public function stroke($file){
$this->graph->Stroke('/www/htdocs/ajaxmonyet/tmp/'.$file);
}
}
?>