PHPackages                             antoineaugusti/easyphpcharts - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. antoineaugusti/easyphpcharts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

antoineaugusti/easyphpcharts
============================

A PHP class for chartjs.org charts.

v0.1.1(11y ago)252.8k16[2 issues](https://github.com/AntoineAugusti/EasyPHPCharts/issues)MITPHPPHP &gt;=5.3.0

Since Aug 2Pushed 11y ago5 watchersCompare

[ Source](https://github.com/AntoineAugusti/EasyPHPCharts)[ Packagist](https://packagist.org/packages/antoineaugusti/easyphpcharts)[ Docs](https://github.com/AntoineAugusti/EasyPHPCharts)[ RSS](/packages/antoineaugusti-easyphpcharts/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

EasyPHPCharts
=============

[](#easyphpcharts)

[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)

A simple PHP class for  charts. Draw a beautiful chart with 5 lines of PHP!

Documentation
-------------

[](#documentation)

You can find documentation at [antoineaugusti.github.io/EasyPHPCharts](http://antoineaugusti.github.io/EasyPHPCharts). Take also a look at the file [`examples/examples.php`](https://github.com/AntoineAugusti/EasyPHPCharts/blob/master/examples/examples.php).

Examples
--------

[](#examples)

```
/*
//	A basic example of a pie chart
*/
$pieChart = new Chart('pie', 'examplePie');
$pieChart->set('data', array(2, 10, 16, 30, 42));
$pieChart->set('legend', array('Work', 'Eat', 'Sleep', 'Listen to music', 'Code'));
$pieChart->set('displayLegend', true);
echo $pieChart->returnFullHTML();

/*
//	An example of a doughnut chart with legend in percentages
*/
$doughnutChart = new Chart('doughnut', 'exampleDoughnut');
$doughnutChart->set('data', array(2, 10, 16, 30, 42));
$doughnutChart->set('legend', array('Work', 'Eat', 'Sleep', 'Listen to music', 'Code'));
$doughnutChart->set('displayLegend', true);
$doughnutChart->set('legendIsPercentage', true);
echo $doughnutChart->returnFullHTML();

/*
//	An example of a bar chart with multiple datasets
*/
$barChart = new Chart('bar', 'examplebar');
$barChart->set('data', array(array(2, 10, 16, 30, 42), array(42, 30, 16, 10, 2)));
$barChart->set('legend', array('01/01', '01/02', '01/03', '01/04', '01/05'));
// We don't to use the x-axis for the legend so we specify the name of each dataset
$barChart->set('legendData', array('Annie', 'Marc'));
$barChart->set('displayLegend', true);
echo $barChart->returnFullHTML();

/*
//	An example of a radar chart
*/
$radarChart = new Chart('radar', 'exampleradar');
$radarChart->set('data', array(20, 55, 16, 30, 42));
$radarChart->set('legend', array('A', 'B', 'C', 'D', 'E'));
echo $radarChart->returnFullHTML();

/*
//	An example of a polar chart
*/
$polarChart = new Chart('polar', 'examplepolar');
$polarChart->set('data', array(20, 55, 16, 30, 42));
$polarChart->set('legend', array('A', 'B', 'C', 'D', 'E'));
echo $polarChart->returnFullHTML();
```

CSS
---

[](#css)

Some CSS classes will be added to the HTML produced. An example CSS file:

```
.chartContainer
{
	float: left;
	width: 500px;
}
.containerChartLegend
{
	float: right;
	width: 500px;
}
canvas.chart
{
	margin: 20px auto;
	display: block;
}
canvas.chart:after
{
	clear: both;
}
.colorBlock
{
	display: inline-block;
	width: 45px;
	height: 15px;
	vertical-align: middle;
	margin-right: 15px;
}
ul.chartLegend
{
	list-style: none;
	margin-bottom: 30px;
}
ul.chartLegend li
{
	margin-bottom: 5px;
}
.floatRight
{
	float: right;
}
.clearBoth
{
	clear: both;
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4307d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bd9d5a56cb260e00c6d1963f9ba430b351227b65fe02ab535960d3b70ff35075?d=identicon)[AntoineAugusti](/maintainers/AntoineAugusti)

---

Top Contributors

[![AntoineAugusti](https://avatars.githubusercontent.com/u/295709?v=4)](https://github.com/AntoineAugusti "AntoineAugusti (6 commits)")

---

Tags

chartchartjschartsvisualizationphp-charts

### Embed Badge

![Health badge](/badges/antoineaugusti-easyphpcharts/health.svg)

```
[![Health](https://phpackages.com/badges/antoineaugusti-easyphpcharts/health.svg)](https://phpackages.com/packages/antoineaugusti-easyphpcharts)
```

###  Alternatives

[icehouse-ventures/laravel-chartjs

Simple package to facilitate and automate the use of charts in Laravel using the Chart.js library

117186.4k](/packages/icehouse-ventures-laravel-chartjs)[onmotion/yii2-widget-apexcharts

Yii2 charts widget - wrapper for the ApexCharts.js

1957.6k1](/packages/onmotion-yii2-widget-apexcharts)[laravel-enso/charts

Server-side data builder for Chart.js, with a VueJS component for the frontend.

1761.1k7](/packages/laravel-enso-charts)[professional-wiki/network

MediaWiki extension for adding interactive network visualizations to your wiki pages

3211.9k](/packages/professional-wiki-network)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
