PHPackages                             ncrousset/piechart - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ncrousset/piechart

ActiveLibrary

ncrousset/piechart
==================

A simple class for drawing pie charts with ImageMagick or GD in PHP.

v2.0.1(12y ago)070GPL-2.0+PHPPHP &gt;=5.3.0

Since Sep 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ncrousset/PieChart)[ Packagist](https://packagist.org/packages/ncrousset/piechart)[ Docs](https://github.com/SamChristy/PieChart)[ RSS](/packages/ncrousset-piechart/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (5)Used By (0)

PieChart
========

[](#piechart)

[![Latest Stable Version](https://camo.githubusercontent.com/a563c4fd51b9fb56cfd1227b4a0c007a0eb55d0d296ebb729db7fc355d4c54cd/68747470733a2f2f706f7365722e707567782e6f72672f73616d636872697374792f70696563686172742f762f737461626c65)](https://packagist.org/packages/samchristy/piechart) [![License](https://camo.githubusercontent.com/b3dd6cc78254f98cbd19362b239a7d7183a2185d9c95524875abdf406896cf1e/68747470733a2f2f706f7365722e707567782e6f72672f73616d636872697374792f70696563686172742f6c6963656e7365)](https://packagist.org/packages/samchristy/piechart) [![Total Downloads](https://camo.githubusercontent.com/883b317c280c4a963b770d78704110949880b1e550d357483514d60546bb506a/68747470733a2f2f706f7365722e707567782e6f72672f73616d636872697374792f70696563686172742f646f776e6c6f616473)](https://packagist.org/packages/samchristy/piechart) [![Monthly Downloads](https://camo.githubusercontent.com/625e5dbbf9d328ebe18ac6719b555cabc65255be0ddcc0227730bef216861262/68747470733a2f2f706f7365722e707567782e6f72672f73616d636872697374792f70696563686172742f642f6d6f6e74686c79)](https://packagist.org/packages/samchristy/piechart)

A reasonably efficient\* class for drawing pie charts with ImageMagick or GD in PHP. Intended as a learning exercise for using the NetBeans IDE and the Xdebug profiler and debugger. The code is available under the [GNU GPL v3.0](http://www.gnu.org/licenses/gpl-3.0.html), so feel free to use it with attribution. I recommend using the Imagick version, `PieChartImagick` over the GD version, `PieChartGD`.

### Demonstration

[](#demonstration)

Below is the code required to generate a pie chart and echo it to the client's browser. The example uses the method `outputPNG()` to tell the browser to render the image. Alternatively, the function `forceDownloadPNG()` can be used to instruct the browser to bring up the save dialog.

### Documentation

[](#documentation)

[View the documentation](http://samchristy.github.com/PieChart/documentation/index.html)(generated with [ApiGen](http://apigen.org/)).

#### Installation

[](#installation)

[Use Composer](https://packagist.org/packages/samchristy/piechart)!

#### Example Usage

[](#example-usage)

```
