Just finished packaging Fileinfo 1.0.3 that finally builds on both PHP 5.1 and 5.0 properly. You can download the new version by running "pecl install fileinfo" or download the tgz file from
I've also made the release of GDChart 0.2 that is nearly a complete rewrite of the extension, originally written by Rasmus that allows it to work with PHP 5.1. This extension wraps around the bundled gdchart library and allows you with just a few lines of code draw 20 different graphs types. Like all pecl extensions it can be installed by running "pecl install gdchart" or you can download the tar ball from
. Since at the moment there is no documentation for the extension, here are a few examples of its usage:
Line Graph:
PHP:
<?php
$g = new GDChart(GDChart::LINE);
$g->addValues(array(2.5, 5.1, 8.6, 12.0, 15, 9, 8, 7));
$g->addValues(array(5.0, 8.0, 9.2, 10.2, 7, 8, 10, 9));
$g->addValues(array(8.0, 10.0, 14.0, 18.2, 16, 14, 12, 10));
$g->setLabels(array("Jan","Feb","Mar","Apr","May","Jun","Jul", "Aug"));
$g->setColors(array(0x1133aa, 0xaa3311, 0x33aa11));
$g->requestedYmin = 0;
$g->ylabelDensity = 25;
$g->ylabelFmt = "%.0f";
$g->out(640,480,GDChart::PNG,"./line.png");
?>
3D Area Graph:
PHP:
<?php
$chart = new gdchart(GDChart::AREA_3D);
$chart->depth = 5;
$chart->xtitle = "Fruits";
$chart->xtitleColor = 0xffff00;
$chart->bgColor = 0x112233;
$chart->xlabelColor = 0xffffff;
$chart->ylabelColor = 0xffffff;
$chart->setColors(array(0x30ffff00, 0x30ff00ff, 0x3000ffff));
$chart->addValues(array(2.5, 5.1, 8.6, 12.0));
$chart->addValues(array(5.0, 8.0, 9.2, 10.2));
$chart->addValues(array(8.0, 10.0, 14.0, 18.2));
$chart->setlabels(array("Apples","Oranges","Melons","Pears"));
$chart->out(640,480,GDChart::PNG,"./3d.png");
?>
3D Combo Graph:
PHP:
<?php
$c = new gdchart(GDChart::COMBO_HLC_AREA_3D);
$c->addScatter(17.0, 3, GDChart::SCATTER_TRIANGLE_UP, 0x50808060, 30);
$c->addValues(array(17.8,17.1,17.3,17.2,17.1,17.3,17.3,17.3,17.1,17.5,17.4));
$c->addValues(array(16.4,16.0,15.7,15.25,16.0,16.1,16.8,16.5,16.8,16.2,16.0));
$c->addValues(array(17.0,16.8,16.9,15.9,16.8,17.2,16.8,17.0,16.9,16.4,16.1));
$c->addCombo(array(150.0,100.0,340.0,999.0,390.0,420.0,150.0,100.0,340.0,1590.0,700.0));
$c->setLabels(array("May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Jan","Feb","Mar","Apr"));
$c->setColors(array(0x1133aa, 0xaa3311, 0x33aa11));
$c->title = "High-Low-Close On top of an Area(volume) Graph";
$c->depth = 5.0;
$c->angle = 50;
$c->annotationFontSize = GDChart::FONT_TINY;
$c->annoNote = "Earnings\nReport";
$c->annoPoint = 8;
$c->volColor = 0x40806040;
$c->grid = GDChart::TICK_LABELS;
$c->ylabelDensity = 40;
$c->hlcStyle = GDChart::HLC_CONNECTING | GDChart::HLC_I_CAP | GDChart::HLC_DIAMOND;
$c->out(640,480,GDChart::PNG,"./combo.png");
?>
3D Pie Graph:
PHP:
<?php
$chart = new gdchart(GDChart::PIE_3D);
$chart->title = "This is a Sample Pie Chart";
$chart->edgeColor = 0x000000;
$chart->setLabels(array("red","green\r\n(exploded)", "lt blue","purple","missing","cyan","blue"));
$chart->addValues(array(12.5, 20.1, 2.0, 22.0, 5.0, 18.0, 13.0));
$chart->setMissing(array(FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE));
$chart->setexplode(array(0,40,0,0,0,0,0));
$chart->pieDepth = 30;
$chart->perspective = 0;
$chart->pieAngle = 90;
$chart->labelLine = false;
$chart->percentLabels = GDChart::LABEL_ABOVE;
$chart->out(640,480,GDChart::PNG, "./pie.png");
?>