require_once '../../includes/connection_settings.php';
require_once '../../classes/adodb/adodb.inc.php';
require_once '../../classes/graph_data_class.php';
/*
 * 
 */
//Create object
$DB = NewADOConnection($_type_of_db_server);
$_res_db = @$DB->Connect($_host, $_user, $_password, $_db_name);
$GRAPH_DATA1 = new graph_data(&$DB);
/*
 * Lib
 */
$data = $GRAPH_DATA1->agTest();
$min_size = 0;
$GRAPH_DATA1->getSensorDataSet($xdata, "", $min_size, "");
/* Create the data and label array */
for ($i = 0; $i < count($xdata); $i++) {
    $xlabel[$i] = $xdata[$i][0];
    $ydata[$i] = $xdata[$i][1];
}
require_once 'jpgraph/src/jpgraph.php';
require_once 'jpgraph/src/jpgraph_line.php';
$width = $_GET['width'];
$height = $_GET['height'];
$chart_title = "Sensor vs. Number of Alerts";
$xaxis_label = "Sensor";
$yaxis_label = "Alert Occurrences";
/*测试jpgraph*/
$GRAPH = new Graph($width, $height);
$GRAPH->SetScale('intint');
            }
        }
        break;
    case 12:
        $chart_title = "Signature Classification vs. Number of Alerts";
        $xaxis_label = "Classification";
        $yaxis_label = "Alert Occurrences";
        /*
                  $data_pnt_cnt = $GRAPH_DATA->getClassificationDataSet($xdata, $chart_type, $min_size, $criteria);
        */
        break;
    case 13:
        $chart_title = "Sensor vs. Number of Alerts";
        $xaxis_label = "Sensor";
        $yaxis_label = "Alert Occurrences";
        $data_pnt_cnt = $GRAPH_DATA->getSensorDataSet($xdata, $chart_type, $time_begin, $time_end);
        if ($isStart == "1" && $isEnd == "1") {
            $chart_title = $chart_title . "\n ( " . $time_begin[3] . "-" . $time_begin[2] . "-" . $time_begin[1] . " - " . $time_end[3] . "-" . $time_end[2] . "-" . $time_end[1] . " )";
        } else {
            if ($isStart == "1") {
                $chart_title = $chart_title . "\n ( " . $time_begin[3] . "-" . $time_begin[2] . "-" . $time_begin[1] . " -  )";
            } else {
                if ($isEnd == "1") {
                    $chart_title = $chart_title . "\n (   -  " . $time_end[3] . "-" . $time_end[2] . "-" . $time_end[1] . " )";
                }
            }
        }
        break;
}
/*
 * $chart_interval = 0, 7, 24, 24X7