Rev | Line | |
---|
[42] | 1 | <?php // content="text/plain; charset=utf-8"
|
---|
| 2 | require_once ('jpgraph/jpgraph.php');
|
---|
| 3 | require_once ('jpgraph/jpgraph_bar.php');
|
---|
| 4 |
|
---|
| 5 | // Some data
|
---|
| 6 | $databary=array(12,7,16,6,7,14,9,3);
|
---|
| 7 | $months=$gDateLocale->GetShortMonth();
|
---|
| 8 |
|
---|
| 9 | // New graph with a drop shadow
|
---|
| 10 | $graph = new Graph(300,200,'auto');
|
---|
| 11 | $graph->SetShadow();
|
---|
| 12 |
|
---|
| 13 | // Use a "text" X-scale
|
---|
| 14 | $graph->SetScale("textlin");
|
---|
| 15 |
|
---|
| 16 | // Specify X-labels
|
---|
| 17 | $graph->xaxis->SetTickLabels($months);
|
---|
| 18 |
|
---|
| 19 | // Set title and subtitle
|
---|
| 20 | $graph->title->Set("Textscale with specified labels");
|
---|
| 21 |
|
---|
| 22 | // Use built in font
|
---|
| 23 | $graph->title->SetFont(FF_FONT1,FS_BOLD);
|
---|
| 24 |
|
---|
| 25 | // Create the bar plot
|
---|
| 26 | $b1 = new BarPlot($databary);
|
---|
| 27 | $b1->SetLegend("Temperature");
|
---|
| 28 |
|
---|
| 29 | //$b1->SetAbsWidth(6);
|
---|
| 30 | //$b1->SetShadow();
|
---|
| 31 |
|
---|
| 32 | // The order the plots are added determines who's ontop
|
---|
| 33 | $graph->Add($b1);
|
---|
| 34 |
|
---|
| 35 | // Finally output the image
|
---|
| 36 | $graph->Stroke();
|
---|
| 37 |
|
---|
| 38 | ?>
|
---|
| 39 |
|
---|
| 40 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.