gdchart is a fast graphing extension written entirely in C. It can handle most common types of graphs with the only major missing feature being that it currently doesn't handle legends. Either create your own legend beside your graph, or maybe even layer it into the background image of your gdchart graph if you have a static legend.

Line Chart
<?php
 Header
("Content-type: image/png");
 
$chart = new gdchart(LINE);
 
$chart->add(array(2.55.18.612.015987));
 
$chart->add(array(5.08.09.210.278109));
 
$chart->add(array(8.010.014.018.216141210));
 
$chart->labels = array("Jan","Feb","Mar","Apr","May","Jun","Jul""Aug");
 
$chart->colors = array(0x1133aa0xaa33110x33aa11);
 
$chart->out(640,480,IMG_PNG);
?>
Output
Line Chart with custom axes
<?php
 Header
("Content-type: image/png");
 
$chart = new gdchart(LINE);
 
$chart->add(array(2.55.18.612.015987));
 
$chart->add(array(5.08.09.210.278109));
 
$chart->add(array(8.010.014.018.216141210));
 
$chart->labels = array("Jan","Feb","Mar","Apr","May","Jun","Jul""Aug");
 
$chart->requested_ymin 0;
 
$chart->ylabel_density 25;
 
$chart->ylabel_fmt "%.0f";
 
$chart->colors = array(0x001133aa0x00aa33110x33aa11);
 
$chart->out(640,480,IMG_PNG);
?>
Output
3D Area Chart
<?php
 Header
("Content-type: image/png");
 
$chart = new gdchart(AREA_3D);
 
$chart->depth 5;
 
$chart->xtitle "Fruits";
 
$chart->xtitle_color 0xffff00;
 
$chart->bg_color 0x112233;
 
$chart->xlabel_color 0xffffff;
 
$chart->ylabel_color 0xffffff;
 
$chart->colors = array(0x30ffff000x30ff00ff0x3000ffff);
 
$chart->add(array(2.55.18.612.0));
 
$chart->add(array(5.08.09.210.2));
 
$chart->add(array(8.010.014.018.2));
 
$chart->labels = array("Apples","Oranges","Melons","Pears");
 
$chart->out(640,480,IMG_PNG);
?>
Output
Pie Chart
<?php
 Header
("Content-type: image/png");
 
$chart = new gdchart(PIE_3D);
 
$chart->title "This is a Sample Pie Chart";

 
$chart->title_font "/usr/share/fonts/truetype/CANDY.ttf ";
 
$chart->title_ptsize 24;

 
$chart->label_font "/usr/share/fonts/truetype/Jester.ttf";
 
$chart->label_ptsize 16;

 
$chart->edge_color 0x000000;
 
$chart->labels = array("red","green\r\n(exploded)",
                        
"lt blue","purple","missing","cyan","blue");
 
$chart->add(array(12.520.12.022.05.018.013.0));
 
$chart->missing = array(FALSEFALSEFALSEFALSETRUEFALSEFALSE);
 
$chart->explode = array(0,40,0,0,0,0,0);

 
$chart->pie_depth 30;
 
$chart->perspective 0;
 
$chart->pie_angle 90;
 
$chart->label_line false;
 
$chart->percent_labels LABEL_ABOVE;

 
$chart->out(640,480,IMG_PNG);
?>
Output
Combo High-Low-Close Chart
<?php
 Header
("Content-type: image/png");
 
$chart = new gdchart(COMBO_HLC_AREA_3D);
 
$chart->title "High-Low-Close On top of an Area(volume) Graph";
 
$chart->depth 5.0;
 
$chart->angle 50;
 
$chart->annotation_font_size FONT_TINY;
 
$chart->anno_note "Earnings\nReport";
 
$chart->anno_point 8;
 
$chart->vol_color 0x40806040;
 
$chart->grid TICK_LABELS;
 
$chart->ylabel_density 40;
 
$chart->hlc_style HLC_CONNECTING HLC_I_CAP HLC_DIAMOND;
 
$chart->add_scatter(17.03SCATTER_TRIANGLE_UP0x5080806030);
 
$chart->add(array(17.8,17.1,17.3,17.2,17.1,17.3,17.3,17.3,17.1,17.5,17.4));
 
$chart->add(array(16.4,16.0,15.7,15.25,16.0,16.1,16.8,16.5,16.8,16.2,16.0));
 
$chart->add(array(17.0,16.8,16.9,15.9,16.8,17.2,16.8,17.0,16.9,16.4,16.1));
 
$chart->add_combo(
   array(
150.0,100.0,340.0,999.0,390.0,420.0,150.0,100.0,340.0,1590.0,700.0));
 
$chart->labels = array("May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Jan","Feb","Mar","Apr");
 
$chart->out(640,480,IMG_PNG);
?>
Output