PHPackages                             diagro/lib\_php\_chart - 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. diagro/lib\_php\_chart

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

diagro/lib\_php\_chart
======================

Library for creating ChartJS in PHP.

1.3.2(3y ago)08DiagroPHPPHP ^8.1

Since Mar 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/diagro-git/lib_php_chart)[ Packagist](https://packagist.org/packages/diagro/lib_php_chart)[ RSS](/packages/diagro-lib-php-chart/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

[![](https://camo.githubusercontent.com/325e42b3bf080dd1bc33264b9402a504541a44e0c94d1502b9f0949824090348/68747470733a2f2f64696167726f2e62652f6173736574732f696d672f64696167726f2d6c6f676f2e737667)](https://www.diagro.be)

[![PHP chart library](https://camo.githubusercontent.com/3189e89a44471e74a2271e4b3d3f1747737eb4200929b390e7664ea198a7aa56/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f6a6563742d6c69625f7068705f63686172742d79656c6c6f77677265656e)](https://camo.githubusercontent.com/3189e89a44471e74a2271e4b3d3f1747737eb4200929b390e7664ea198a7aa56/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f6a6563742d6c69625f7068705f63686172742d79656c6c6f77677265656e)[![Diagro library](https://camo.githubusercontent.com/a12b18cef1becf97b15535b43c90e88121420bd070d64ae62f285861b368c724/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f747970652d6c6962726172792d696e666f726d6174696f6e616c)](https://camo.githubusercontent.com/a12b18cef1becf97b15535b43c90e88121420bd070d64ae62f285861b368c724/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f747970652d6c6962726172792d696e666f726d6174696f6e616c)[![PHP](https://camo.githubusercontent.com/9435393fe453789bca167ce7c81f5e1ee1ef27bf8a01b770b1b9ddb078f53e3d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e302d626c756576696f6c6574)](https://camo.githubusercontent.com/9435393fe453789bca167ce7c81f5e1ee1ef27bf8a01b770b1b9ddb078f53e3d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e302d626c756576696f6c6574)[![chartjs](https://camo.githubusercontent.com/15e93e54b7f3cff4bf8ba4d19fe33b4532cf81102551101d1250986a47078413/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63686172746a732d332e332e302d6f72616e6765)](https://camo.githubusercontent.com/15e93e54b7f3cff4bf8ba4d19fe33b4532cf81102551101d1250986a47078413/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63686172746a732d332e332e302d6f72616e6765)

Description
-----------

[](#description)

Create charts with ChartJS through PHP. You make the chart in PHP code and serialize it to Javascript. In Javascript you create the chart by deserialize the output of the PHP Chart class.

The Manager class holds the graphs and is responsible for rendering.

```
$("canvas[id^='chart_']").each(function(idx, el) {
	new Chart(
		$(el).attr('id'),
		$.parseJSON(atob($(el).data('chart')))
	);
});
```

If you use Laravel. Simply register the Manager class in the AppServiceProvider.

```
public function register()
{
	$this->app->singleton('charts', \Diagro\Chart\Manager::class);
}
```

In a blade view:

```
{{ app('charts')->render('chart_id') }}

```

Or register a stringable blade like:

```
Blade::stringable(\Diagro\Chart\Chart::class, function($chart) {
    return app('charts')->render($chart->id);
});
```

Example:

```
$chart = new Chart('messages_per_time', Chart::TYPE_BAR);
$chart->labels = array_keys($per_datetime);
$chart->datasets[0] = new \Diagro\Chart\Datasets\Bar('Aantal per tijdstip');
$chart->datasets[0]->data = array_values($per_datetime);
$chart->datasets[0]->background_color = [
	new \Diagro\Chart\Color\RGBA(255,99,132,0.2),
	new \Diagro\Chart\Color\RGBA(54,162,235,0.2)
];
$chart->datasets[0]->border_color = [
	new \Diagro\Chart\Color\RGBA(255,99,132,1),
	new \Diagro\Chart\Color\RGBA(54,162,235,1)
];
$chart->datasets[0]->border_width = 1;

$chart->options->plugins->legend->display = false;
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~33 days

Total

5

Last Release

1436d ago

PHP version history (2 changes)1.0PHP ^8.0

1.3PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dca2fd1216ba699bad0020b482994e4843f936f70b88408c25744e5914f7f95?d=identicon)[diagro-git](/maintainers/diagro-git)

---

Top Contributors

[![stijn1989](https://avatars.githubusercontent.com/u/6877485?v=4)](https://github.com/stijn1989 "stijn1989 (10 commits)")

### Embed Badge

![Health badge](/badges/diagro-lib-php-chart/health.svg)

```
[![Health](https://phpackages.com/badges/diagro-lib-php-chart/health.svg)](https://phpackages.com/packages/diagro-lib-php-chart)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

592.6k2](/packages/crumbls-layup)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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