PHPackages                             ejdamm/chart.js-php - 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. ejdamm/chart.js-php

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

ejdamm/chart.js-php
===================

PHP Wrapper for Chart.js.

v2.0(8y ago)3411.9k↓32.6%13MITPHPPHP &gt;=5.6

Since Mar 10Pushed 7y ago6 watchersCompare

[ Source](https://github.com/Ejdamm/Chart.js-PHP)[ Packagist](https://packagist.org/packages/ejdamm/chart.js-php)[ Docs](https://github.com/Ejdamm/Chart.js-PHP)[ RSS](/packages/ejdamm-chartjs-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (2)Used By (0)

Chart.js-PHP
============

[](#chartjs-php)

[![Build Status](https://camo.githubusercontent.com/40f563add867ef9f81a1aebf8bfe563eba1359a80cf42410c919e4f90e9290b4/68747470733a2f2f7472617669732d63692e6f72672f456a64616d6d2f43686172742e6a732d5048502e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Ejdamm/Chart.js-PHP)

A PHP wrapper for [chartjs/Chart.js](https://github.com/chartjs/Chart.js)This project is an expansion of [HugoHeneault's](https://github.com/HugoHeneault/Chart.js-PHP) repository

How to use
----------

[](#how-to-use)

Include [js/Chart.min.js](js/Chart.min.js) and [js/driver.js](js/driver.js) before the end of your body (change src according to your project). If you want to use CDN instead see \[here\](. For CDN see here )

```

```

Install ChartJS-PHP via composer

```
{
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/Ejdamm/Chart.js-PHP"
        }],
    "require": {
        "ejdamm/chart.js-php": "dev-master"
    }
}
```

Then, create your charts using PHP.

```
$data = [
    'labels' => ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
    'datasets' => [[
        'data' =>[8, 7, 8, 9, 6],
        'backgroundColor' => '#f2b21a',
        'borderColor' => '#e5801d',
        'label' => 'Legend'
    ]]
];
$options = [];
$attributes = ['id' => 'example', 'width' => 500, 'height' => 500];
$Line = new ChartJs\ChartJS('line', $data, $options, $attributes);

// Echo your line
echo $Line;
?>
```

Finally, load these charts with a small piece of javascript when your document is ready

```
// Pure JS document.ready
(function() {
  loadChartJsPhp();
})();
```

Full example
------------

[](#full-example)

```

    Chart.js-PHP

      (function() {
        loadChartJsPhp();
      })();

```

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

[](#documentation)

Full documentation is available at [Chart.js](http://www.chartjs.org/docs/latest/charts/) website. There you can find what type of charts and associated properties are available.

Time axis
---------

[](#time-axis)

If you are going to use time axis you need either to include Moment.js or Chart.bundle.js instead of Chart.js to your project. Chart.bundle.js consists of both Chart.js and Moment.js (which is needed for time axis).

Contributing
------------

[](#contributing)

Do not hesitate to edit or improve my code with bugfix and new functionalities!

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.7% 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

Unknown

Total

1

Last Release

2992d ago

### Community

Maintainers

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

---

Top Contributors

[![Ejdamm](https://avatars.githubusercontent.com/u/2567087?v=4)](https://github.com/Ejdamm "Ejdamm (42 commits)")[![HugoHeneault](https://avatars.githubusercontent.com/u/4112256?v=4)](https://github.com/HugoHeneault "HugoHeneault (23 commits)")[![christof-b](https://avatars.githubusercontent.com/u/1691776?v=4)](https://github.com/christof-b "christof-b (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ejdamm-chartjs-php/health.svg)

```
[![Health](https://phpackages.com/badges/ejdamm-chartjs-php/health.svg)](https://phpackages.com/packages/ejdamm-chartjs-php)
```

###  Alternatives

[crankycyclops/m2-module-discount-code-url

Allows discount codes to be applied to a browser session automatically via a query string or URL path.

4112.3k](/packages/crankycyclops-m2-module-discount-code-url)[fritzmg/contao-news-related

Simple Contao 4+ bundle for setting related news directly.

113.8k](/packages/fritzmg-contao-news-related)[terabin/flarum-ext-sitemap

Generate a Sitemap for Flarum automatically

103.0k1](/packages/terabin-flarum-ext-sitemap)

PHPackages © 2026

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