PHPackages                             fundevogel/tiny-phpeanuts - 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. fundevogel/tiny-phpeanuts

ActiveLibrary

fundevogel/tiny-phpeanuts
=========================

A tiny PHP library for creating SVG donut (and pie) charts.

1.0.2(4y ago)1314.4k↓34.6%21MITPHP

Since Aug 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/fundevogel/tiny-phpeanuts)[ Packagist](https://packagist.org/packages/fundevogel/tiny-phpeanuts)[ Docs](https://github.com/Fundevogel)[ RSS](/packages/fundevogel-tiny-phpeanuts/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (9)Used By (1)

tiny-phpeanuts
==============

[](#tiny-phpeanuts)

[![Release](https://camo.githubusercontent.com/248e63e3b959c6a544c51d82c114fb07d87483a6f8dcc464f8bc1a3668869ed5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f46756e6465766f67656c2f74696e792d70687065616e7574732e737667)](https://github.com/Fundevogel/tiny-phpeanuts/releases) [![License](https://camo.githubusercontent.com/7d5de3cb20d3231fc502b2e3a5035cb47eb290a15fee6406bc068bff84a985f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f46756e6465766f67656c2f74696e792d70687065616e7574732e737667)](https://github.com/Fundevogel/tiny-phpeanuts/blob/master/LICENSE) [![Issues](https://camo.githubusercontent.com/225da2caf40cf22adba0fdcdcf356fa9f52f175a17e0ecfb65ed6b32c1d6f179/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f46756e6465766f67656c2f74696e792d70687065616e7574732e737667)](https://github.com/Fundevogel/tiny-phpeanuts/issues) [![Status](https://camo.githubusercontent.com/c00c70f0e98d70a6ac7befd530c96adffd8824f1aac702a6c5884dfe979d2b6d/68747470733a2f2f7472617669732d63692e6f72672f66756e6465766f67656c2f74696e792d70687065616e7574732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fundevogel/tiny-phpeanuts)

A tiny PHP library for creating SVG donut (and pie) charts.

What
----

[](#what)

This library is a PHP port of the TypeScript library [`tiny-donuts`](https://github.com/Verivox/tiny-donuts).

Why
---

[](#why)

> We needed Donut charts - however, Chart.js was a much too powerful (and big) for our use case and added &gt;200kb to our browser application.
>
> So we wrote this small library with a minified size of 4 KiB.

While `tiny-donuts` is a great library, we needed something less client-side and more server-side.

So we ported their library to PHP.

How
---

[](#how)

Install this package with [Composer](https://getcomposer.org):

```
composer require fundevogel/tiny-phpeanuts

```

### Configuration

[](#configuration)

The `Donut` class takes three parameters:

ParameterTypeDefaultDescription`$entries`array-data to be visualized`$thickness`floatsee belowthickness of the chart`$spacing`floatsee belowspacing between the segments### Options

[](#options)

.. and there's even more! Check out these 'global' options:

SetterTypeDefaultDescription`setSize`int`100`dimensions of chart`setBackgroundColor`string`'transparent'`background fill color`setPreferViewbox`bool`true``viewBox` &gt; width &amp; height`setClasses`string`''`classes applied to chart`setRole`string`'img'`role attribute`setPieChart`bool`false`make it a pie chart### Example

[](#example)

```
