forked from halo-battle/game
Version 1.12
This commit is contained in:
parent
2a066a7498
commit
de31cd3e9a
1373 changed files with 156282 additions and 45238 deletions
45
onyx2/include/jpgraph/Examples/bartutex5.php
Normal file
45
onyx2/include/jpgraph/Examples/bartutex5.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
include ("../jpgraph.php");
|
||||
include ("../jpgraph_bar.php");
|
||||
|
||||
// Some data
|
||||
$months=$gDateLocale->GetShortMonth();
|
||||
|
||||
srand ((double) microtime() * 1000000);
|
||||
for( $i=0; $i<25; ++$i) {
|
||||
$databary[]=rand(1,50);
|
||||
$databarx[]=$months[$i%12];
|
||||
}
|
||||
|
||||
// New graph with a drop shadow
|
||||
$graph = new Graph(300,200,'auto');
|
||||
$graph->SetShadow();
|
||||
|
||||
// Use a "text" X-scale
|
||||
$graph->SetScale("textlin");
|
||||
|
||||
// Specify X-labels
|
||||
$graph->xaxis->SetTickLabels($databarx);
|
||||
$graph->xaxis->SetTextLabelInterval(1);
|
||||
$graph->xaxis->SetTextTickInterval(3);
|
||||
|
||||
// Set title and subtitle
|
||||
$graph->title->Set("Bar tutorial example 5");
|
||||
|
||||
// Use built in font
|
||||
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
||||
|
||||
// Create the bar plot
|
||||
$b1 = new BarPlot($databary);
|
||||
$b1->SetLegend("Temperature");
|
||||
$b1->SetWidth(0.4);
|
||||
|
||||
// The order the plots are added determines who's ontop
|
||||
$graph->Add($b1);
|
||||
|
||||
// Finally output the image
|
||||
$graph->Stroke();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue