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 | |
---|
| 5 | $datay = array(20,10,35,5,17,35,22); |
---|
| 6 | |
---|
| 7 | // Setup the graph |
---|
| 8 | $graph = new Graph(400,200); |
---|
| 9 | $graph->SetMargin(40,40,20,30); |
---|
| 10 | $graph->SetScale("intlin"); |
---|
| 11 | $graph->SetBox(); |
---|
| 12 | $graph->SetMarginColor('darkgreen@0.8'); |
---|
| 13 | |
---|
| 14 | // Setup a background gradient image |
---|
| 15 | $graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT); |
---|
| 16 | |
---|
| 17 | $graph->title->Set('Gradient filled line plot ex2'); |
---|
| 18 | $graph->yscale->SetAutoMin(0); |
---|
| 19 | |
---|
| 20 | // Create the line |
---|
| 21 | $p1 = new LinePlot($datay); |
---|
| 22 | $p1->SetFillGradient('white','darkgreen'); |
---|
| 23 | $graph->Add($p1); |
---|
| 24 | |
---|
| 25 | // Output line |
---|
| 26 | $graph->Stroke(); |
---|
| 27 | |
---|
| 28 | ?> |
---|
| 29 | |
---|
| 30 | |
---|
Note: See
TracBrowser
for help on using the repository browser.