<?
session_start();
include ('../../db.php');
include ('../../functions.php');
ConnectDB();
require_once ('../../jpgraph/src/jpgraph.php');
require_once ('../../jpgraph/src/jpgraph_line.php');
// Create the graph and specify the scale for both Y-axis
$graph = new Graph(665,500,"auto");
$graph->img->SetMargin(90,10,40,200); // left, right, top, bottom
$graph->SetScale("textlin");
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.5,0.9999,"center","bottom");
// Set the Title Of the Graph
$graph->title->Set($_SESSION['ReportArray']['title']);
$graph->title->SetFont(FF_FONT2,FS_BOLD);
// x-axis - the horizontal one
$graph->xaxis->SetTitle($_SESSION['ReportArray']['xtitle'],'middle');
$graph->xaxis->SetTitleSide(SIDE_BOTTOM);
$graph->xaxis->SetTitlemargin(75);
// Setup X-scale
$graph->xaxis->SetTickLabels($_SESSION['ReportArray']['datax']);
$graph->xaxis->SetFont(FF_FONT1,FS_NORMAL,8);
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// y-axis - the vertical one
$graph->yaxis->SetTitle($_SESSION['ReportArray']['ytitle'],'middle');
$graph->yaxis->SetTitleSide(SIDE_BOTTOM);
$graph->yaxis->SetTitlemargin(75);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$colorArray = array ("darkgreen", "darkred", "darkblue", "forestgreen"); //, "darkslategray", "darkolivegreen", "darkgoldenrod4");
$k=-1;
// Create the bar plots