Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function barChart($filename, $ydata, $xdata){
- // Create the graph. These two calls are always required
- $graph = new Graph(900,500);
- $graph->SetScale('textlin');
- //(bunch of styling stuff)
- // Create the bar plot
- $bplot=new BarPlot($ydata);
- // Add the plot to the graph
- $graph->Add($bplot);
- //(more styling stuff)
- // Display the graph
- $graph->Stroke($filename);
- $graph = null;
- $bplot = null;
- unset($graph);
- unset($bplot);
- echo "<br><br>".(memory_get_peak_usage(true)/1048576)."<br><br>";
- }
- // load fonts only once, and define a constant for them
- define("GD_FF_FONT0", imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT0.gdf"));
- define("GD_FF_FONT1", imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT1.gdf"));
- define("GD_FF_FONT2", imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT2.gdf"));
- define("GD_FF_FONT1_BOLD", imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT1-Bold.gdf"));
- define("GD_FF_FONT2_BOLD", imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT2-Bold.gdf"));
- $this->ff_font0 = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT0.gdf");
- $this->ff_font1 = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT1.gdf");
- $this->ff_font2 = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT2.gdf");
- $this->ff_font1_bold = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT1-Bold.gdf");
- $this->ff_font2_bold = imageloadfont(dirname(__FILE__) . "/fonts/FF_FONT2-Bold.gdf");
- $this->ff_font0 = GD_FF_FONT0;
- $this->ff_font1 = GD_FF_FONT1;
- $this->ff_font2 = GD_FF_FONT2;
- $this->ff_font1_bold = GD_FF_FONT1_BOLD;
- $this->ff_font2_bold = GD_FF_FONT2_BOLD;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement