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_utils.inc.php'); |
---|
| 5 | |
---|
| 6 | $f = new FuncGenerator('cos($i)','$i*$i*$i'); |
---|
| 7 | list($xdata,$ydata) = $f->E(-M_PI,M_PI,25); |
---|
| 8 | |
---|
| 9 | $graph = new Graph(300,200); |
---|
| 10 | $graph->SetScale("linlin"); |
---|
| 11 | $graph->SetMargin(50,50,20,30); |
---|
| 12 | $graph->SetFrame(false); |
---|
| 13 | $graph->SetBox(true,'black',2); |
---|
| 14 | $graph->SetMarginColor('white'); |
---|
| 15 | $graph->SetColor('lightyellow'); |
---|
| 16 | |
---|
| 17 | $graph->title->Set('Duplicating Y-axis'); |
---|
| 18 | $graph->title->SetFont(FF_FONT1,FS_BOLD); |
---|
| 19 | |
---|
| 20 | $graph->SetAxisStyle(AXSTYLE_YBOXIN); |
---|
| 21 | $graph->xgrid->Show(); |
---|
| 22 | |
---|
| 23 | $lp1 = new LinePlot($ydata,$xdata); |
---|
| 24 | $lp1->SetColor("blue"); |
---|
| 25 | $lp1->SetWeight(2); |
---|
| 26 | $graph->Add($lp1); |
---|
| 27 | |
---|
| 28 | $graph->Stroke(); |
---|
| 29 | ?> |
---|
| 30 | |
---|
| 31 | |
---|
Note: See
TracBrowser
for help on using the repository browser.