[42] | 1 | <?php // content="text/plain; charset=utf-8"
|
---|
| 2 | require_once ('jpgraph/jpgraph.php');
|
---|
| 3 | require_once ('jpgraph/jpgraph_error.php');
|
---|
| 4 |
|
---|
| 5 | $errdatay = array(11,9,2,4,19,26,13,19,7,12);
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | // Create the graph. These two calls are always required
|
---|
| 9 | $graph = new Graph(300,200);
|
---|
| 10 | $graph->SetScale("textlin");
|
---|
| 11 |
|
---|
| 12 | $graph->img->SetMargin(40,30,20,40);
|
---|
| 13 | $graph->SetShadow();
|
---|
| 14 |
|
---|
| 15 | // Create the error plot
|
---|
| 16 | $errplot=new ErrorPlot($errdatay);
|
---|
| 17 | $errplot->SetColor("red");
|
---|
| 18 | $errplot->SetWeight(2);
|
---|
| 19 | $errplot->SetCenter();
|
---|
| 20 |
|
---|
| 21 | // Add the plot to the graph
|
---|
| 22 | $graph->Add($errplot);
|
---|
| 23 |
|
---|
| 24 | $graph->title->Set("Simple error plot");
|
---|
| 25 | $graph->xaxis->title->Set("X-title");
|
---|
| 26 | $graph->yaxis->title->Set("Y-title");
|
---|
| 27 |
|
---|
| 28 | $graph->title->SetFont(FF_FONT1,FS_BOLD);
|
---|
| 29 | $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
---|
| 30 | $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
|
---|
| 31 |
|
---|
| 32 | $datax = $gDateLocale->GetShortMonth();
|
---|
| 33 | $graph->xaxis->SetTickLabels($datax);
|
---|
| 34 |
|
---|
| 35 | // Display the graph
|
---|
| 36 | $graph->Stroke();
|
---|
| 37 | ?>
|
---|