$v) { if(preg_match("/^d/", $k, $regs)) { $datay[] = $v; } } $label = array(); $count = 0; foreach($_REQUEST as $k => $v) { if(preg_match("/^l/", $k, $regs)) { $label[] = $v; if(strlen($v) > $count) { $count = strlen($v); } } } if($test == '3dmark2001') { $title = '3DMark 2001'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == '3dmark2003') { $title = '3DMark 2003 1024 x 768 no AA no AF'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == '3dmark2003_2') { $title = '3DMark 2003 1024 x 768 no AA no AF'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == '3dmark2003_3') { $title = '3DMark 2003 1024 x 768 no AA no AF'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == '3dmark2005') { $title = '3DMark 2005 1024 x 768 no AA no AF'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == '3dmark2005_2') { $title = '3DMark 2005 1024 x 768 no AA no AF'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == '3dmark2005_3') { $title = '3DMark 2005 1024 x 768 no AA no AF'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == '3dmark2006') { $title = '3DMark 2006 1024 x 768'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == '3dmark2006_2') { $title = '3DMark 2006 1280 x 1024'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == '3dmark2006_3') { $title = '3DMark 2006 1600 x 1200'; $ytitle = '3DMarks - Higher score is better.'; $format = '%.0f '; } elseif($test == 'utbm') { $title = 'UT2003 Demo Botmatch - 1024 x 768'; $ytitle = 'FPS - Higher score is better.'; $format = '%.3f '; } elseif($test == 'utfb') { $title = 'UT2003 Demo Flyby - 1024 x 768'; $ytitle = 'FPS - Higher score is better.'; $format = '%.3f '; } elseif($test == 'ss2') { $title = 'Serious Sam 2'; $ytitle = 'Lower is Better'; $format = '%.3f '; } elseif($test == 'gm1') { $title = 'Gun Metal Demo 1'; $ytitle = 'Average Frame Per Second'; $format = '%.3f '; } elseif($test == 'gm2') { $title = 'Gun Metal Demo 2'; $ytitle = 'Average Frame Per Second'; $format = '%.3f '; } elseif($test == 'aquamark3') { $title = 'Aquamark3'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'ffx1') { $title = 'Final Fantasy XI'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'halo') { $title = 'Halo'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'farcry_1') { $title = 'Far Cry 1024 x 768 No AA No AF'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'farcry_2') { $title = 'Far Cry 1024 x 768 4x AA 8x AF'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'farcry_3') { $title = 'Far Cry 1280 x 1024 No AA No AF'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'farcry_4') { $title = 'Far Cry 1280 x 1024 4x AA 8x AF'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'farcry_5') { $title = 'Far Cry 1280 x 960 4x AA 8x AF'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'farcry_6') { $title = 'Far Cry 1280 x 960 4x AA 8x AF'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'farcry_7') { $title = 'Far Cry 1600 x 1200 no AA no AF'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'farcry_8') { $title = 'Far Cry 1600 x 1200 4x AA 8x AF'; $ytitle = ''; $format = '%.3f '; } elseif($test == 'doom3_1') { $title = 'Doom 3 - 1024 x 768 no AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'doom3_2') { $title = 'Doom 3 - 1024 x 768 4x AA 8x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'doom3_3') { $title = 'Doom 3 - 1280 x 1024 no AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'doom3_4') { $title = 'Doom 3 - 1280 x 1024 4x AA 8x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; }elseif($test == 'doom3_5') { $title = 'Doom 3 - 1280 x 960 no AA no AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; }elseif($test == 'doom3_6') { $title = 'Doom 3 - 1280 x 960 4x AA 8x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; }elseif($test == 'doom3_7') { $title = 'Doom 3 - 1600 x 1200 no AA no AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; }elseif($test == 'doom3_8') { $title = 'Doom 3 - 1600 x 1200 4x AA 8x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'hl2_1') { $title = 'Half Life 2 Canal - 1024 x 768 No AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'hl2_2') { $title = 'Half Life 2 Coast - 1024 x 768 No AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'hl2_3') { $title = 'Half Life 2 Canal - 1024 x 768 4x AA 8x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'hl2_4') { $title = 'Half Life 2 Coast - 1024 x 768 4x AA 8x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'hl2_5') { $title = 'Half Life 2 Canal - 1280 x 1024 No AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'hl2_6') { $title = 'Half Life 2 Coast - 1280 x 1024 No AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'hl2_7') { $title = 'Half Life 2 Canal - 1280 x 1024 4x AA 8x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'hl2_8') { $title = 'Half Life 2 Coast - 1280 x 1024 4x AA 8x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'FEAR1') { $title = 'F.E.A.R 1024 x 768 No AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'FEAR2') { $title = 'F.E.A.R 1024 x 768 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'FEAR3') { $title = 'F.E.A.R. 1280x1024 no AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'FEAR4') { $title = 'F.E.A.R 1280x1024 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'FEAR5') { $title = 'F.E.A.R 1280x960 no AA no AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'FEAR6') { $title = 'F.E.A.R 1280x960 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'FEAR7') { $title = 'F.E.A.R 1600x1200 no AA no AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'FEAR8') { $title = 'F.E.A.R 1600x1200 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'quake1') { $title = 'Quake4 1024x768 no AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'quake2') { $title = 'Quake4 1024x768 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'quake3') { $title = 'Quake4 1280x1024 No AA no AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'quake4') { $title = 'Quake4 1280x1024 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'quake5') { $title = 'Quake4 1280x960 no AA no AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'quake6') { $title = 'Quake4 1280x960 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'quake7') { $title = 'Quake4 1600x1200 no AA no AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'quake8') { $title = 'Quake4 1600x2100 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'COD1') { $title = 'Call of Duty II 1024x768 no AA No AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'COD2') { $title = 'Call of Duty II 1024 x 768 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'COD3') { $title = 'Call of Duty II 1280 x 1024 No AA no AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'COD4') { $title = 'Call of Duty II 1280 x 1024 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'COD5') { $title = 'Call of Duty II 1600 x 1200 no AA no AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } elseif($test == 'COD6') { $title = 'Call of Duty II 1600 x 1200 4x AA 16x AF'; $ytitle = 'FPS - Higher score is better.'; $format = '%.1f '; } //Begin Conversion ::EO:: $errors=array(); if(isset($_GET['sel'])){$insel = $_GET['sel'];}else{$insel = 1;} $intitle = $title; if(isset($_GET['legA'])){$inlegA = $_GET['legA'];}else{$inlegA = "";} if(isset($_GET['legB'])){$inlegB = $_GET['legB'];}else{$inlegB = "";} if(isset($_GET['sub'])){$insub = $_GET['sub'];}else{$insub = $ytitle;} if(isset($_GET['ymax'])){$inymax = $_GET['ymax'];}else{$inymax = 0;} if(isset($_GET['rot'])){$rot = $_GET['rot'];}else{$rot = NULL;} if(isset($_GET['dec'])){$dec = $_GET['dec'];}else{$dec = $format;} $ymin = min($datay) * 0; array_multisort($datay, SORT_DESC, $label); if($count>8) { $height=370; } $namear=$label; $valA=$datay; $valB=array(); /* $namear=array(); $valA=array(); $valB=array(); foreach($_GET as $key => $val) { $subst = substr($key, 0, 4); if($subst !="name" && !is_numeric($val)) { $val=0; } switch($subst) { case "name": array_push($namear, $val); break; case "scrA": array_push($valA, $val); break; case "scrB": array_push($valB, $val); break; } } if(empty($namear) && empty($valA)) { array_push($errors, 'Missing: All graphing data!'); } else { if(empty($namear)) { array_push($errors, 'Missing: Data names'); } if(empty($valA)) { array_push($errors, 'Missing: Data values'); } } if(count($namear) != count($valA)) { array_push($errors, 'Names + Values do not match.'); } if($sel==2) { if(empty($valB)) { array_push($errors, 'Missing: 2nd Values'); } if(count($namear) != count($valB)) { array_push($errors, 'Names + 2nd Values do not match.'); } } */ if(count($errors)<1) { $width=500; $height=475; // Set the basic parameters of the graph $graph = new Graph($width,$height,'auto'); $graph->SetScale("textlin"); //$icon = new IconPlot('logo.png',0.5,0.5,1,50); //$graph->SetBackgroundImage("./images/graph_bg.png",BGIMG_FILLFRAME); $graph->SetColor('#555555'); $graph->SetMarginColor('#555555'); $graph->SetBackgroundGradient('#3F4A61','#797979',GRAD_HOR,BGRAD_PLOT); $graph->SetFrame(true,'#000000',1); $top = 40; $numlen=$valA[0]; settype($numlen,"string"); $finlen=strlen($numlen); if($finlen>=4) { $bottom = 80; $rot=true; } else { $bottom = 65; } $left = 150; $right = 30; $titlemargin = $bottom-10; $graph->Set90AndMargin($left,$right,$top,$bottom); //$graph->SetTickDensity(TICKD_VERYSPARSE); // Nice shadow //$graph->SetShadow("#111111"); // Setup labels foreach($namear as $key => $lbdat) { $namear[$key]=wordwrap($lbdat,20,"\n"); } $graph->xaxis->SetTickLabels($namear); $graph->yaxis->SetPos('max'); // Label align for X-axis $graph->xaxis->SetLabelAlign('right','center','right'); $graph->yaxis->SetLabelSide(SIDE_RIGHT); //$graph->xaxis->SetTickSide(SIDE_TOP); // Label align for Y-axis $graph->yaxis->SetLabelAlign('center','top'); if(strlen($inlegA)>8) { $xmod = strlen($inlegA)-8; $xmod = $xmod *.01; $xmod = .82 - $xmod; $insub = " ".$insub; } else { $xmod=.85; } // Titles $graph->title->Set($intitle); $graph->title->SetFont(FF_IMPACT,FS_NORMAL,18); $graph->title->SetMargin(8); $graph->yaxis->SetTitle($insub,'low'); $graph->yaxis->SetTitleSide(SIDE_TOP); $graph->yaxis->SetTitleMargin($titlemargin); $graph->yaxis->title->SetFont(FF_EVROPA,FS_NORMAL,11); $graph->yaxis->title->SetAngle(0); $graph->yaxis->title->SetColor('#FFFFFF'); $graph->yaxis->title->SetAlign('center','right'); $graph->title->SetColor('#FFFFFF'); $graph->yaxis->SetColor('#FFFFFF'); $graph->xaxis->SetColor('#FFFFFF'); if($rot!=NULL) { $graph->yaxis->SetLabelAngle(45); $graph->yaxis->SetFont(FF_BANK,FS_NORMAL,10); $ymod=.86; } else { $graph->yaxis->SetFont(FF_BANK,FS_NORMAL,10); $ymod=.87; } $graph->xaxis->SetFont(FF_EVROPA,FS_NORMAL,10); // Create a bar pot /* if($dec!=NULL) { switch($dec) { case 2: $format = '%.2f '; break; case 3: $format = '%.3f '; break; default: $format = '%.0f '; break; } } else { $format = '%.0f '; } */ $bplot = new BarPlot($valA); $bplot->SetFillGradient("#ACC1FF",'#001757',GRAD_HOR); $bplot->SetColor("#FFFFFF"); $bplot->SetWidth(.5); $bplot->SetShadow(); $bplot->SetValuePos('center'); $bplot->value->Show(); $bplot->value->SetFont(FF_BANK,FS_NORMAL,10); $bplot->value->SetAlign('right','center'); $bplot->value->SetColor("#FFFFFF"); $bplot->value->SetFormat($format); if($inymax!=0) { $bplot->SetYMin($inymax); } if($sel==2) { $bplot->SetLegend($inlegA); $b2plot = new BarPlot($valB); $b2plot->SetFillGradient("#F15D03",'#FFA821',GRAD_HOR); $b2plot->SetColor("#FFFFFF"); $b2plot->SetWidth(.5); $b2plot->SetShadow(); $b2plot->SetValuePos('center'); $b2plot->value->Show(); $b2plot->value->SetFont(FF_BANK,FS_NORMAL,10); $b2plot->value->SetAlign('right','center'); $b2plot->value->SetColor("#000"); $b2plot->value->SetFormat($format); $b2plot->SetLegend($inlegB); if($inymax!=0) { $b2plot->SetYMin($inymax); } $graph->legend->Pos($xmod,$ymod); $graph->legend->SetShadow('#111111', 2); $graph->legend->SetFont(FF_BANK,FS_NORMAL,10); $graph->legend->SetColor('#FFFFFF'); $graph->legend->SetFillColor('#777777'); $gbplot = new GroupBarPlot(array($bplot,$b2plot)); if($inymax!=0) { $gbplot->SetYMin($inymax); } $graph->Add($gbplot); } else { $graph->Add($bplot); } // A more real life example $txt = new Text("Motherboards.org"); $txt->SetFont(FF_ARIALBLACK,FS_NORMAL,14); $txt->Pos(480,100,'center','bottom'); $txt->SetColor('#FFFFFF'); $graph->AddText($txt); $graph->ygrid->SetColor('#999999'); $graph->ygrid->SetLineStyle('dashed'); $graph->ygrid->Show(); $graph->Stroke(); } else { print_r($errors); $str="?ti=DOOM III 1024x768&sel=2&sub=FPS - Higher is better&legA=No AA&legB=4x AA&name1=ATI X1800XL&name2=Gigabyte 660GT SPII&name3=EVGA 7800GT SLI&name4=EVGA 7800GT&name5=XFX SLI&name6=XFX 7800GT&name7=Gigabyte 7800GT&scrA1=66&scrA2=25&scrA3=45&scrA4=56&scrA5=88&scrA6=72&scrA7=46&scrB1=55&scrB2=14&scrB3=38&scrB4=45&scrB5=72&scrB6=68&scrB7=38"; echo(urlencode($str)); } ?>