Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php // content="text/plain; charset=utf-8"
  2. require_once ('jpgraph/jpgraph.php');
  3. require_once ('jpgraph/jpgraph_bar.php');
  4.  
  5. $datay=array(12, 8, 19, 3, 10, 5, 8, 12);
  6. $datax=array('User1', 'User2', 'User3', 'User4', 'User5', 'User6', 'User7', 'User8');
  7.  
  8. // Create the graph. These two calls are always required
  9. $graph = new Graph(600,400);   
  10. $graph->SetScale("textlin");
  11.  
  12. // Add a drop shadow
  13. $graph->SetShadow();
  14.  
  15. // Adjust the margin a bit to make more room for titles
  16. $graph->img->SetMargin(50,40,20,50);
  17. $graph->xaxis->SetTickLabels($datax);
  18.  
  19. // Create a bar pot
  20. $bplot = new BarPlot($datay);
  21.  
  22. // Adjust fill color
  23. $bplot->SetFillColor('darkred');
  24. $bplot->value->Show();
  25. $graph->Add($bplot);
  26.  
  27. // Setup the titles
  28. $graph->title->Set("");
  29. $graph->xaxis->title->Set("Member");
  30. $graph->yaxis->title->Set("Posts per day");
  31.  
  32. $graph->title->SetFont(FF_FONT1,FS_BOLD);
  33. $graph->yaxis->title->SetFont(FF_FONT2,FS_BOLD);
  34. $graph->xaxis->title->SetFont(FF_FONT2,FS_BOLD);
  35.  
  36. // Display the graph
  37. $graph->Stroke();
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement