Added client work scripts
[clearscm.git] / clients / GD / FSMon / testgraph.php
1 <?php
2 $inc = "/var/www/html/Fsmon";
3
4 include_once ("$inc/pChart/pData.class");
5 include_once ("$inc/pChart/pChart.class");
6
7 $fonts = "$inc/Fonts";
8
9 // Dataset definition   
10 $DataSet = new pData;
11
12 // Free first
13 // $DataSet->AddPoint (0, "Free", 1);
14 // $DataSet->AddPoint (0, "Used", 1);
15 // $DataSet->AddPoint (70, "Free", 2);
16 // $DataSet->AddPoint (30, "Used", 2);
17 // $DataSet->AddPoint (80, "Free", 3);
18 // $DataSet->AddPoint (20, "Used", 3);
19 // $DataSet->AddPoint (90, "Free", 4);
20 // $DataSet->AddPoint (10, "Used", 4);
21
22 // Used first
23 $DataSet->AddPoint (0, "Used", 1);
24 $DataSet->AddPoint (70, "Used", 2);
25 $DataSet->AddPoint (80, "Used", 3);
26 $DataSet->AddPoint (90, "Used", 4);
27 $DataSet->AddPoint (0, "Free", 1);
28 $DataSet->AddPoint (30, "Free", 2);
29 $DataSet->AddPoint (20, "Free", 3);
30 $DataSet->AddPoint (10, "Free", 4);
31
32 $DataSet->AddAllSeries();
33 $DataSet->SetAbsciseLabelSerie();
34
35 // Initialise the graph
36 $Test = new pChart (700, 280);
37
38 $Test->setColorPalette (1, 0, 255, 0);
39 $Test->setColorPalette (0, 255, 0, 0);
40
41 $Test->drawGraphAreaGradient (100, 150, 175, 100, TARGET_BACKGROUND);
42 $Test->setFontProperties ("$fonts/tahoma.ttf", 8);
43 $Test->setGraphArea (50, 30, 680, 200);
44 $Test->drawRoundedRectangle (5, 5, 695, 275, 5, 230, 230, 230);
45 $Test->drawGraphAreaGradient (162, 183, 202, 50);
46 $Test->drawScale ($DataSet->GetData (), $DataSet->GetDataDescription (), SCALE_ADDALL, 200, 200, 200, true, 70, 2, true);
47 $Test->drawGrid (4, true, 230, 230, 230, 50);
48
49 // Draw the 0 line
50 $Test->setFontProperties ("$fonts/tahoma.ttf", 6);
51 $Test->drawTreshold (0, 143, 55, 72, true, true);
52
53 // Draw the bar graph
54 $Test->drawStackedBarGraph ($DataSet->GetData (), $DataSet->GetDataDescription (), 75);
55
56 // Finish the graph
57 $Test->setFontProperties ("$fonts/tahoma.ttf",8);
58 $Test->drawLegend (610, 35, $DataSet->GetDataDescription (), 130, 180, 205);
59 $Test->setFontProperties ("$fonts/tahoma.ttf", 10);
60 $Test->drawTitle (50, 22, "$system:$mount", 255, 255, 255, 675);
61 $Test->Stroke ();
62 ?>