include "/var/www/html/oi_defcon_awr12/jpgraph-1.20.5/src/jpgraph.php"; include "/var/www/html/oi_defcon_awr12/jpgraph-1.20.5/src/jpgraph_bar.php"; $chart_data = unserialize(base64_decode($_GET['chart_data'])); $chart_leg = unserialize(base64_decode($_GET['chart_leg'])); $chart_title = $_GET['chart_title']; $chart_data_label = $_GET['chart_data_label']; //$str1 = "ala ma kota draw chart"; //printf("[%s]<br>",$str1); //print_r($chart_data); //print_r($chart_leg); //$graph = new Graph(1250,250,"auto"); $graph = new Graph(1250, 450, "auto"); $graph->SetScale("textint"); //$graph->img->SetMargin(120,30,50,75); $graph->img->SetMargin(120, 30, 50, 165); $graph->AdjBackgroundImage(0.4, 0.7, -1); //setting BG type $graph->SetShadow(); $graph->title->Set($chart_title); $graph->subtitle->Set($chart_data_label); $graph->xaxis->SetFont(FF_ARIAL, FS_NORMAL, 8); $graph->xaxis->SetLabelAngle(90); $graph->xaxis->SetTickLabels($chart_leg); function yLabelFormat($aLabel) { // Format '1000 english style return number_format($aLabel); // Format '1000 french style //return number_format($aLabel, 2, ',', ' '); } $graph->yaxis->SetLabelFormatCallback('yLabelFormat');
<?php include "../jpgraph.php"; include "../jpgraph_line.php"; // Some data $datay = array(28, 19, 18, 23, 12, 11); $data2y = array(14, 18, 33, 29, 39, 55); // A nice graph with anti-aliasing $graph = new Graph(400, 200, "auto"); $graph->img->SetMargin(40, 180, 40, 40); $graph->SetBackgroundImage("tiger_bkg.png", BGIMG_FILLPLOT); // Adjust brightness and contrast for background image // must be between -1 <= x <= 1, (0,0)=original image $graph->AdjBackgroundImage(0, 0); $graph->img->SetAntiAliasing("white"); $graph->SetScale("textlin"); $graph->SetShadow(); $graph->title->Set("Background image"); // Use built in font $graph->title->SetFont(FF_FONT1, FS_BOLD); // Slightly adjust the legend from it's default position in the // top right corner. $graph->legend->Pos(0.05, 0.5, "right", "center"); // Create the first line $p1 = new LinePlot($datay); $p1->mark->SetType(MARK_FILLEDCIRCLE); $p1->mark->SetFillColor("red"); $p1->mark->SetWidth(4); $p1->SetColor("blue"); $p1->SetCenter(); $p1->SetLegend("Triumph Tiger -98");