Rev | Line | |
---|
[42] | 1 | <?php // content="text/plain; charset=utf-8" |
---|
| 2 | require_once ('jpgraph/jpgraph.php'); |
---|
| 3 | require_once ('jpgraph/jpgraph_line.php'); |
---|
| 4 | require_once ('jpgraph/jpgraph_flags.php'); |
---|
| 5 | require_once ('jpgraph/jpgraph_iconplot.php'); |
---|
| 6 | |
---|
| 7 | $datay = array(30,25,33,25,27,45,32); |
---|
| 8 | |
---|
| 9 | // Setup the graph |
---|
| 10 | $graph = new Graph(400,250); |
---|
| 11 | $graph->SetMargin(40,40,20,30); |
---|
| 12 | $graph->SetScale("textlin"); |
---|
| 13 | |
---|
| 14 | $graph->title->Set('Adding a country flag as a an icon'); |
---|
| 15 | |
---|
| 16 | $p1 = new LinePlot($datay); |
---|
| 17 | $p1->SetColor("blue"); |
---|
| 18 | $p1->SetFillGradient('yellow@0.4','red@0.4'); |
---|
| 19 | |
---|
| 20 | $graph->Add($p1); |
---|
| 21 | |
---|
| 22 | $icon = new IconPlot(); |
---|
| 23 | $icon->SetCountryFlag('iceland',50,30,1.5,40,3); |
---|
| 24 | $icon->SetAnchor('left','top'); |
---|
| 25 | $graph->Add($icon); |
---|
| 26 | |
---|
| 27 | // Output line |
---|
| 28 | $graph->Stroke(); |
---|
| 29 | |
---|
| 30 | ?> |
---|
| 31 | |
---|
| 32 | |
---|
Note: See
TracBrowser
for help on using the repository browser.