Rev | Line | |
---|
[42] | 1 | <?php |
---|
| 2 | require_once ('../jpgraph.php'); |
---|
| 3 | require_once ('../jpgraph_line.php'); |
---|
| 4 | |
---|
| 5 | $datay = array(0,3,5,12,15,18,22,36,37,41); |
---|
| 6 | |
---|
| 7 | // Setup the graph |
---|
| 8 | $graph = new Graph(320,200); |
---|
| 9 | $graph->title->Set('Education growth'); |
---|
| 10 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,14); |
---|
| 11 | $graph->SetScale('intlin'); |
---|
| 12 | $graph->SetMarginColor('white'); |
---|
| 13 | $graph->SetBox(); |
---|
| 14 | //$graph->img->SetAntialiasing(); |
---|
| 15 | |
---|
| 16 | $graph->SetGridDepth(DEPTH_FRONT); |
---|
| 17 | $graph->ygrid->SetColor('gray@0.7'); |
---|
| 18 | $graph->SetBackgroundImage('classroom.jpg',BGIMG_FILLPLOT); |
---|
| 19 | |
---|
| 20 | // Masking graph |
---|
| 21 | $p1 = new LinePlot($datay); |
---|
| 22 | $p1->SetFillColor('white'); |
---|
| 23 | $p1->SetFillFromYMax(); |
---|
| 24 | $p1->SetWeight(0); |
---|
| 25 | $graph->Add($p1); |
---|
| 26 | |
---|
| 27 | // Line plot |
---|
| 28 | $p2 = new LinePlot($datay); |
---|
| 29 | $p2->SetColor('black@0.4'); |
---|
| 30 | $p2->SetWeight(3); |
---|
| 31 | $p2->mark->SetType(MARK_SQUARE); |
---|
| 32 | $p2->mark->SetColor('orange@0.5'); |
---|
| 33 | $p2->mark->SetFillColor('orange@0.3'); |
---|
| 34 | $graph->Add($p2); |
---|
| 35 | |
---|
| 36 | // Output line |
---|
| 37 | $graph->Stroke(); |
---|
| 38 | |
---|
| 39 | ?> |
---|
| 40 | |
---|
| 41 | |
---|
Note: See
TracBrowser
for help on using the repository browser.