PHPackages                             mapescador/chartjs-bundle - 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. mapescador/chartjs-bundle

ActiveSymfony-bundle

mapescador/chartjs-bundle
=========================

build awesome charts directly from your ORM Entities

2.0.7(9mo ago)020↓100%MITPHPPHP ^8

Since Jun 1Pushed 9mo agoCompare

[ Source](https://github.com/mpescadorsantirso/MukadiChartJSBundle)[ Packagist](https://packagist.org/packages/mapescador/chartjs-bundle)[ RSS](/packages/mapescador-chartjs-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (5)Versions (14)Used By (0)

Mukadi ChartJs Bundle
=====================

[](#mukadi-chartjs-bundle)

Build awesome charts directly from ORM Entities, using `MukadiChartJsBundle` to create high quality chart mapped directly to your data model. `MukadiChartJsBundle` is an adaptation of the [mukadi/chartjs-builder](https://github.com/mbo2olivier/mukadi-chartjs-builder) package for symfony, Here are some provided features:

- a service for build chart from DQL queries
- a service for build chart from Native SQL queries
- a Twig extension for render chart in the view

Installation
------------

[](#installation)

Install the bundle via composer by running the following command:

`php composer.phar require mukadi/chartjs-bundle`

And run `php bin/console assets:install` for installing assets in the public web directory

Chart builder
-------------

[](#chart-builder)

The bundle provide two chart builders as service:

*service**class**description*mukadi\_chart\_js.dqlMukadi\\ChartJSBundle\\Chart\\BuilderFor building chart from a DQL querymukadi\_chart\_js.nativeMukadi\\ChartJSBundle\\Chart\\NativeBuilderFor building chart from a native SQL queryYou can use chart builders like any other symfony service:

```
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Mukadi\Chart\Utils\RandomColorFactory;
use Mukadi\ChartJSBundle\Chart\Builder
use Mukadi\Chart\Chart;

class AppController extends Controller{

    public function chart(Builder $builder) {
        $builder
            ->query('SELECT COUNT(*) total, p.type FROM \App\Entity\Post p GROUP BY p.type')
            ->addDataset('total','Total',[
                "backgroundColor" => RandomColorFactory::getRandomRGBAColors(6)
            ])
            ->labels('type')
        ;

        $chart = $builder->buildChart('my_chart',Chart::PIE);
        return $this->render('chart.html.twig',[
            "chart" => $chart,
        ]);
    }
}
```

You can also pass a Doctrine\\ORM\\Query object instead of a DQL query. This allow you to use a repository to store your charts queries.

```
    ...
    $query = $this->getDoctrine()->getManager()->createQuery('SELECT COUNT(*) total, p.type FROM \App\Entity\Post p GROUP BY p.type');

    $builder
            ->query($query)
            ->addDataset('total','Total',[
                "backgroundColor" => RandomColorFactory::getRandomRGBAColors(6)
            ])
            ->labels('type')
        ;
...
```

Please, see the [mukadi/chartjs-builder documentation](https://github.com/mbo2olivier/mukadi-chartjs-builder) if you want to learn more about chart construction.

Render chart in twig template
-----------------------------

[](#render-chart-in-twig-template)

In twig template use the dedicated function for chart rendering:

```
{{ mukadi_chart(chart) }}
```

Don't forget to include libraries in your page:

```

```

And that's all !

###  Health Score

38

—

LowBetter than 86% of packages

Maintenance56

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~302 days

Total

13

Last Release

291d ago

Major Versions

0.0.2 → 1.0.02018-07-21

1.0.2 → 2.0.02020-11-13

PHP version history (6 changes)0.0.1PHP &gt;=5.3.7

1.0.0PHP &gt;=5.4

2.0.0PHP ^7.1.3

2.0.1PHP ^7.1.3||^8.0

2.0.4PHP ^8.3

2.0.5PHP ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/3663391ef7663ead7709e934986e156b565720283a2b4a629150fb155bb5d4f8?d=identicon)[mpescadorsantirso](/maintainers/mpescadorsantirso)

---

Top Contributors

[![mbo2olivier](https://avatars.githubusercontent.com/u/6231735?v=4)](https://github.com/mbo2olivier "mbo2olivier (15 commits)")[![mpescadorsantirso](https://avatars.githubusercontent.com/u/44074790?v=4)](https://github.com/mpescadorsantirso "mpescadorsantirso (15 commits)")[![psyray](https://avatars.githubusercontent.com/u/1230954?v=4)](https://github.com/psyray "psyray (2 commits)")

---

Tags

graphicschartjsSymfony BundlechartsChart builder

### Embed Badge

![Health badge](/badges/mapescador-chartjs-bundle/health.svg)

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

###  Alternatives

[fx3costa/laravelchartjs

Simple package to facilitate and automate the use of charts in Laravel 5.x using Chartjs v2 library

486467.9k4](/packages/fx3costa-laravelchartjs)[icehouse-ventures/laravel-chartjs

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

116170.8k](/packages/icehouse-ventures-laravel-chartjs)[phpsword/sword-bundle

Modern WordPress development with Symfony

1378.7k](/packages/phpsword-sword-bundle)[jawira/doctrine-diagram-bundle

📐 Symfony Bundle to generate database diagrams

8081.1k1](/packages/jawira-doctrine-diagram-bundle)[laravel-enso/charts

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

1760.6k5](/packages/laravel-enso-charts)[antoineaugusti/easyphpcharts

A PHP class for chartjs.org charts.

252.8k](/packages/antoineaugusti-easyphpcharts)

PHPackages © 2026

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