示例#1
0
 function testRRDGraph()
 {
     $graph = new RRDGraph(450, 150);
     //Add DEF
     $graph->AddDEF("L1", dirname(__FILE__) . "/test.rrd", "L1", "AVERAGE");
     $graph->AddDEF("L2", dirname(__FILE__) . "/test.rrd", "L2", "AVERAGE");
     $graph->AddDEF("L3", dirname(__FILE__) . "/test.rrd", "L3", "AVERAGE");
     //Add Lines
     $graph->AddLine(1, "L1", "#00FF00", "Test line 1");
     $graph->AddLine(2, "L2", "#FF0000", "Test line 2");
     // Add  Area
     $graph->AddArea("L3", "#0000FF", "Test area");
     $graph->SetXGridStyle("WEEK", 1, "MONTH", 1, "MONTH", 1, 1, "%b");
     $graph->Title = "TEST GRAPH";
     $res = $graph->Plot("/tmp/test.gif", "-1y", "now");
     $this->assertTrue($res, "Graph created");
 }