DBInitialise(); $sql_object -> DBConnexion(); //$sdi_object= new sdi; //$value=$sdi_object->GetAllValue("SCP", $scale_id, $id, $sql_object); //$result_sdii=$sdi_object->GetInfoSdi($id, $sql_object); $req_sdiav=SQL_getAllValue("SCP", $scale_id, $id); $value = $sql_object -> DBSelect($req_sdiav); $req_sdii=SQL_getInfoSdi($id); $result_sdii = $sql_object -> DBSelect($req_sdii); include ("../class/system/jpgraph/jpgraph.php"); include ("../class/system/jpgraph/jpgraph_bar.php"); include ("../class/system/jpgraph/jpgraph_line.php"); $unit=$result_sdii[0]['sdii_unit']; $title=formatText($result_sdii[0]['sdii_name']); $title=cutText($title, 50, 0); for ($i=0; $iGetShortMonth(); // Create the graph. $graph = new Graph(450,300); $graph->SetScale("textlin"); $graph->SetMarginColor('white'); // Adjust the margin slightly so that we use the // entire area (since we don't use a frame) $graph->SetMargin(45,1.5,30,70); // Box around plotarea $graph->SetBox(); // No frame around the image $graph->SetFrame(false); // Setup the tab title //$graph->tabtitle->Set($title); //$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,10); $graph->title->SetFont(FF_FONT1,FS_BOLD); //$graph->xaxis->title->Set(“CA 2000 ”); $graph->yaxis->title->Set($result_sdii[0]['sdii_unit']); // Setup the X and Y grid $graph->ygrid->SetFill(true,'#DDDDDD@0.8','#BBBBBB@0.8'); $graph->ygrid->SetLineStyle('dashed'); $graph->ygrid->SetColor('gray@0.5'); $graph->xgrid->Show(); $graph->xgrid->SetLineStyle('dashed'); $graph->xgrid->SetColor('gray@0.5'); // Setup month as labels on the X-axis $graph->xaxis->SetTickLabels($months); $graph->xaxis->SetColor('#848484','#848484'); $graph->yaxis->SetColor('#848484','#848484'); $graph->title->SetFont(FF_FONT1,FS_BOLD,8); //$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8); $graph->xaxis->SetLabelAngle(90); //$graph->xaxis->Label->SetFont(FF_FONT1,FS_BOLD,6); // Create a bar pot $bplot = new BarPlot($ydata); $bplot->SetWidth(0.6); //$fcol='#440000'; //$tcol='#FF9090'; //$fcol='#94B0D0'; //$tcol='#637B92'; $fcol='#99B5D5'; $tcol='#839FBE'; $bplot->SetFillGradient($fcol,$tcol,GRAD_LEFT_REFLECTION); // Set line weigth to 0 so that there are no border // around each bar $bplot->SetWeight(0); // Create filled line plot $lplot = new LinePlot($ydata2); $lplot->SetFillColor('orange@0.8'); $lplot->SetColor('red@0.8'); //$lplot->SetFillFromYMin(1); //$lplot->SetFillColor('skyblue@0.5'); //$lplot->SetColor('navy@0.7'); $lplot->SetBarCenter(); $lplot->mark->SetType(MARK_SQUARE); $lplot->mark->SetColor('red@0.8'); $lplot->mark->SetFillColor('orange'); //$lplot->mark->SetColor('blue@0.5'); //$lplot->mark->SetFillColor('lightblue'); $lplot->mark->SetSize(1); $graph->Add($bplot); $graph->Add($lplot); // .. and finally send it back to the browser $graph->Stroke(); ?>