setValues($_GET['diagram_value'], $_GET['day_start'],$_GET['month_start'],$_GET['year_start'],$_GET['hour_start'],$_GET['minute_start'],$_GET['second_start'], $_GET['day_end'],$_GET['month_end'],$_GET['year_end'],$_GET['hour_end'],$_GET['minute_end'],$_GET['second_end'], $_GET['image_width'],$_GET['image_height'],$_GET['intervall'],$_GET['plots'] ); $show->getSQLValues(); // print_r($this->value[2]); // Create the graph. These two calls are always required $graph = new Graph((int)$_GET['image_width'],(int)$_GET['image_height']); $graph->SetMarginColor('white'); $graph->SetScale("textlin"); $graph->SetFrame(false); $graph->SetMargin(30,50,30,30); $graph->title->Set($_GET['diagram_value']); $graph->yaxis->HideZeroLabel(); $graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5'); $graph->xgrid->Show(); /* for($j=0;$jvalue[1]);$j++){ echo "Time= ".$show->value[0][$j]." | value[1][".$j."]=".$show->value[1][$j]."
"; } */ $labx = array(); for($i=0;$ivalue[0]);$i++){ list($date,$time)=split("[ \t]",$show->value[0][$i]); list($hour,$minute,$second)=split("[:]",$time); $labx[$i] = $hour.":".$minute; } $graph->xaxis->SetTickLabels($labx); //$graph->xaxis->SetFont(FF_VERDANA, FS_NORMAL); $p = array(); $j=0; // echo "count(show->values)=". count($show->values)."
"; /* for($i=0;$ivalue);$i++){ for($j=0;$jvalue[0]);$j++){ echo " |value[".$i."][".$j."]=".$show->value[$i][$j]; } echo "
"; } */ /* for($i=0;$ivalue);$i++){ echo " |value[".$i."][0]=".$show->value[$i][0]; echo "
"; } */ /* $value=array(); // echo "count show->value[1]=".count($show->value[1])."
"; for($i=0;$i<10000;$i++){ $value[$i] = (double) $show->value[1][$i]; } */ for($i=1;$ivalue);$i++){ // Create the first line $p[$j] = new LinePlot($show->value[$i]); $p[$j]->SetColor("navy"); $p[$j]->SetLegend($_GET['plots'][$i-1]); $graph->Add($p[$j]); $j++; } // $graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth()); /* $datay1 = array(800.1234567,15,23,200.1234567); $datay2 = array(12,9,42,8); $datay3 = array(5,17,32,24); */ /* // Create the first line $p1 = new LinePlot($show->value[1]); $p1->SetColor("navy"); $p1->SetLegend('Line 1'); $graph->Add($p1); /* // Create the second line $p2 = new LinePlot($datay2); $p2->SetColor("red"); $p2->SetLegend('Line 2'); $graph->Add($p2); // Create the third line $p3 = new LinePlot($datay3); $p3->SetColor("orange"); $p3->SetLegend('Line 3'); $graph->Add($p3); /**/ $graph->legend->SetShadow('gray@0.4',5); $graph->legend->SetPos(0.1,0.1,'right','top'); // Output line $graph->Stroke(); /* $graph = new Graph(300,300); $graph->SetMarginColor('white'); $graph->SetScale("textlin"); $graph->SetFrame(false); $graph->SetMargin(30,50,30,30); $graph->title->Set('Filled Y-grid'); $graph->yaxis->HideZeroLabel(); $graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5'); $graph->xgrid->Show(); /* $labx = array(); for($i=0;$ivalue[0]);$i++){ list($date,$time)=split("[ \t]",$show->value[0][$i]); list($hour,$minute,$second)=split("[:]",$time); $labx[$i] = $hour.":".$minute; } $graph->xaxis->SetTickLabels($labx); */ /* $datay1 = array(20,15,23,15); $datay2 = array(12,9,42,8); $datay3 = array(5,17,32,24); // Create the first line $p = new LinePlot($datay1); $p->SetColor("navy"); $p->SetLegend('Line 1'); $graph->Add($p); $j++; $p = array(); $j=0; /* for($i=1;$ivalues);$i++){ // Create the first line $p[$j] = new LinePlot($show->values[$i]); $p[$j]->SetColor("navy"); $p[$j]->SetLegend('Line 1'); $graph->Add($p[$j]); $j++; } */ /* $graph->legend->SetShadow('gray@0.4',5); $graph->legend->SetPos(0.1,0.1,'right','top'); // Output line $graph->Stroke(); /* $graph->SetScale("textlin"); $graph->SetY2Scale("log"); // $graph->SetScale( "textlin"); // $graph->SetScale( "textlin",min($this->value[4]),max($this->value[4])); // $graph->SetY2Scale( "lin",min($this->value[6]),max($this->value[6])); // $scale_max = array(); // $scale_min = array(); // array_push($scale_max, max($this->value[4])); // array_push($scale_min, min($this->value[4])); // array_push($scale_max, max($this->value[6])); // array_push($scale_min, min($this->value[6])); // $graph->SetScale("textlin",min($scale_min),max($scale_max)); $graph->img->SetMargin(40,40,40,40); $graph->img->SetAntiAliasing(); // echo "
min=".min($this->value[2])." max=".max($this->value[2])."
"; // $graph->SetShadow(); $graph->title->Set("CO2 - Diagramm"); $graph->title->SetFont(FF_FONT1,FS_BOLD); // print_r($this->value[1]); $graph->xaxis->SetTextLabelInterval(500,0); $labx = array(); for($i=0;$ivalue[0]);$i++){ list($date,$time)=split("[ \t]",$this->value[0] [$i]); list($hour,$minute,$second)=split("[:]",$time); $labx[$i] = $hour.":".$minute; } $graph->xaxis->SetTickLabels($labx); // $graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8); // $graph->xaxis->SetLabelAngle(45); $graph->xaxis->SetFont(FF_FONT1,FS_NORMAL,1); // $graph->xaxis->SetLabelAngle(90); $graph->xaxis->title->Set(date("d.m.Y")); $graph->yaxis->title->Set("ppmCO2"); // $graph->yaxis->title->Set("Y-title"); $graph->ygrid->Show(true,true); // $graph->xgrid->Show(true); $graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5'); // Use 20% "grace" to get slightly larger scale then min/max of $graph->yscale->SetGrace(20); // $plot[0] = new LinePlot($this->value[4]);//,$Vm_time); // $plot[$i]->SetColor("#".$color_r.$color_g.$color_b); // echo $color_r.$color_g.$color_b."
"; // $plot[0]->SetColor("green"); // $plot[0]->SetCenter(); // $graph->Add($plot[0]); for($i=1;$ivalues);$i++){ if($_GET['number_of_values'][$i][1] == 1){ $plot[$i] = new LinePlot($this->value[$i+2]);//,$Vm_time); // $plot[$i]->SetColor("#".$color_r.$color_g.$color_b); // echo $color_r.$color_g.$color_b."
"; $color_r += 10; //eigentl. hex! $color_g += 10; //eigentl. hex! $color_b += 10; //eigentl. hex! $plot[$i]->SetColor("green"); $plot[$i]->SetCenter(); $graph->Add($plot[$i]); } } /* for($i=2;$ivalue);$i++){ $plot[$i] = new LinePlot($this->value[$i]);//,$Vm_time); // $plot[$i]->SetColor("#".$color_r.$color_g.$color_b); // echo $color_r.$color_g.$color_b."
"; $color_r += 10; //eigentl. hex! $color_g += 10; //eigentl. hex! $color_b += 10; //eigentl. hex! $plot[$i]->SetColor("green"); $plot[$i]->SetCenter(); $graph->Add($plot[$i]); } */ // $graph->legend->Pos( 0.05,0.5,"right" ,"center"); // $graph->SetY2Scale( "lin"); // $graph->Stroke(); /**/ } } /* $_GET['plots'] = unserialize(stripslashes(urldecode($_GET['url']))); echo "
plot
"; $_GET['plots']; echo "
"; */ $diagram = new DOWDiagram; /* // print_r($_GET['number_of_values']); for($i=0;$i"; } *//* echo "Hallo
"; for($i=0;$ivalue);$i++){ for($j=0;$jvalue[0]);$j++){ echo " | show->value[".$i."][".$j."]=".$show->value[$i][$j]; } echo "
"; } */ $diagram->Paint(); //http://localhost/upload/SQL/src/show/diagram.php?diagram_value=coz&day_start=20&month_start=04&year_start=2009&hour_start=12&minute_start=52&second_start=03&day_end=20&month_end=05&year_end=2009&hour_end=12&minute_end=05&second_end=03×teps_h=02×teps_min=30×teps_sec=00&plots[]=CO2_18m&plots[]=CO2_2m ?>