Phplot ist ein Script mit dem man Diagramme/Graphen erzeugen kann. Das automatische Abspeichern des Bildes funktioniert bei mir nicht. Ich benutze phplot 5. Ich weiß auch nicht, was ich in dem Script hinzufügen soll, damit es funktioniert. Meine Draw Funktion:
function draw_graph($g_data,$legend,$durchwahl,$output_file){
$graph = new PHPlot(800,600);
$graph->SetPrintImage(0); //Don’t draw the image yet
$graph->SetDataType(„data-data“);
$graph->SetDataValues($g_data);
$graph->SetTitle(„Telefongespräche 2006 von Durchwahl „.$durchwahl);
$graph->SetImageArea(800,600);
$graph->SetYLabel(„Anzahl“);
$graph->SetXLabel(„Wochen“);
$graph->SetXTimeFormat(“%W „);
$graph->SetVertTickIncrement(100);
$graph->SetHorizTickIncrement(500000);
$graph->SetXGridLabelType(„time“);
$graph->SetXDataLabelAngle(90);
$graph->SetPlotType(„lines“);
$graph->SetYScaleType(„linear“);
$graph->SetLineWidth(1);
$graph->SetDrawXDataLabels(false);
$graph->SetLegend($legend);
$graph->DrawGraph();
$graph->SetOutputFile($output_file);
$graph->:stuck_out_tongue_winking_eye:rintImage();
}
function main(){
$table_name=„telefon_calls“;
$dat=database_operations(„1“,$table_name);
// 1 for open
$new_dat=change_duration_format($dat);
$dat=$new_dat;
$localyear=„06“;
//welche durchwahl soll betrachtet werden?
$local_durchwahl=„11“;
$image_file=“/“.$local_durchwahl.„weekvalues“.$localyear.„png“;
$image_file=‚C:\Programme\xampp\xampp\htdocs\telefon\weekvalues.png‘;
$g_dat=make_graph_data($dat,$localyear,$local_durchwahl);
$legend=array(">0 min",">2 min",„1-2min“,"