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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mapescador/chartjs-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

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

build awesome charts directly from your ORM Entities

2.0.7(1y ago)021MITPHPPHP ^8

Since Jun 1Pushed 1y agoCompare

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

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

36

—

LowBetter than 79% of packages

Maintenance48

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

383d 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

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M373](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1715.6k12](/packages/2lenet-crudit-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

939.0k](/packages/ahmed-bhs-doctrine-doctor)

PHPackages © 2026

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