Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php // content="text/plain; charset=utf-8"
- require_once ('jpgraph/jpgraph.php');
- require_once ('jpgraph/jpgraph_bar.php');
- $datay=array(12, 8, 19, 3, 10, 5, 8, 12);
- $datax=array('User1', 'User2', 'User3', 'User4', 'User5', 'User6', 'User7', 'User8');
- // Create the graph. These two calls are always required
- $graph = new Graph(600,400);
- $graph->SetScale("textlin");
- // Add a drop shadow
- $graph->SetShadow();
- // Adjust the margin a bit to make more room for titles
- $graph->img->SetMargin(50,40,20,50);
- $graph->xaxis->SetTickLabels($datax);
- // Create a bar pot
- $bplot = new BarPlot($datay);
- // Adjust fill color
- $bplot->SetFillColor('darkred');
- $bplot->value->Show();
- $graph->Add($bplot);
- // Setup the titles
- $graph->title->Set("");
- $graph->xaxis->title->Set("Member");
- $graph->yaxis->title->Set("Posts per day");
- $graph->title->SetFont(FF_FONT1,FS_BOLD);
- $graph->yaxis->title->SetFont(FF_FONT2,FS_BOLD);
- $graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
- // Display the graph
- $graph->Stroke();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement