PHPackages                             nggiahao/laravel-dashboard-chart-tile - 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. nggiahao/laravel-dashboard-chart-tile

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

nggiahao/laravel-dashboard-chart-tile
=====================================

Generic chart tiles for laravel dashboard

01PHP

Since Nov 21Pushed 2y agoCompare

[ Source](https://github.com/AIV-T-Shark/laravel-dashboard-chart-tile)[ Packagist](https://packagist.org/packages/nggiahao/laravel-dashboard-chart-tile)[ RSS](/packages/nggiahao-laravel-dashboard-chart-tile/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Dashboard Charting Tile
===============================

[](#laravel-dashboard-charting-tile)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1af281b8dee3b8b28ebc870adb61a02bb4d2af9e0cc10d616941470f784330dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666964756d2f6c61726176656c2d64617368626f6172642d63686172742d74696c652e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/fidum/laravel-dashboard-chart-tile)[![GitHub Workflow Status (with branch)](https://camo.githubusercontent.com/85889d2a0bb95d1f91ce425c8776ac232f8d5163451d8a54f43236ca86917ed3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f666964756d2f6c61726176656c2d64617368626f6172642d63686172742d74696c652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666f722d7468652d6261646765)](https://github.com/fidum/laravel-dashboard-chart-tile/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Codecov](https://camo.githubusercontent.com/86ac3c54bf6a44ed51390b28aee66c2970ed9c00625d1b53615382f7625209ce/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f666964756d2f6c61726176656c2d64617368626f6172642d63686172742d74696c653f6c6f676f3d636f6465636f76266c6f676f436f6c6f723d7768697465267374796c653d666f722d7468652d6261646765)](https://codecov.io/gh/fidum/laravel-dashboard-chart-tile)[![Twitter Follow](https://camo.githubusercontent.com/3ecd70148f9f16e2e0d66fcde3428926f1df4d6797ea463473ccf60dcdf7758a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666f6c6c6f772d25343064616e6d61736f6e6d702d3144413146323f6c6f676f3d74776974746572267374796c653d666f722d7468652d6261646765)](https://twitter.com/danmasonmp)

Show off your charting skills with this easy to use tile. Supports line, bar, pie, doughnut and many more!

[![Preview](docs/preview.png)](docs/preview.png)

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

[](#installation)

You can install the package via composer:

```
composer require fidum/laravel-dashboard-chart-tile
```

Usage
-----

[](#usage)

In the `dashboard` config file, you can optionally add this configuration in the `tiles` key.

```
// in config/dashboard.php
return [
    // ...
    'tiles' => [
        'charts' => [
            'refresh_interval_in_seconds' => 300, // Default: 300 seconds (5 minutes)
        ],
    ],
];
```

This tile uses `chart.js` to render the charts with the help of `Laravel Charts` package see links to documentation for both below:

- [Laravel Charts Documentation](https://charts.erik.cat/)
- [Chart.js Documentation](https://www.chartjs.org/docs/latest/charts/)

So that you can easily add your datasets and configure your charts exactly how you want them you need to create a chart class that implements the `Fidum\ChartTile\Contracts\ChartFactory` interface.

See chart example below:

```
namespace App\Charts;

use Carbon\Carbon;
use Fidum\ChartTile\Charts\Chart;
use Fidum\ChartTile\Contracts\ChartFactory;

class ExampleBarChart implements ChartFactory
{
    public static function make(array $settings): ChartFactory
    {
        return new static;
    }

    public function chart(): Chart
    {
        $date = Carbon::now()->subMonth()->startOfDay();

        $data = collect(range(0, 12))->map(function ($days) use ($date) {
            return [
                'x' => $date->clone()->addDays($days)->toDateString(),
                'y' => rand(100, 500),
            ];
        });

        $chart = (new Chart)
            ->labels($data->pluck('x')->toArray())
            ->options([
                  'responsive' => true,
                  'maintainAspectRatio' => false,
                  // etc...
             ], true);

        $chart->dataset('Example Data', 'bar', $data->toArray())
            ->backgroundColor('#848584');

        return $chart;
    }
}
```

In your dashboard view you can use the below component as many times as needed. Pass your chart class reference to the component and that will be used to generate the chart.

```

```

### Optional properties:

[](#optional-properties)

- `chartFilters` optional key value array of settings that is passed to your chart `static::make` method. **Only use this for passing simple values `strings`, `integers`, `arrays` etc.**To use this you will have to use `@livewire` syntax over the component syntax in order set the array value.

```
@livewire('chart-tile', [
    'chartFactory' => App\Charts\DailyUsersChart::class,
    'chartFilters' => ['type' => 'customer'],
])
```

- `height` sets the height of the chart, depending on your dashboard layout you may need to adjust this (defaults to `100%`).
- `refreshIntervalInSeconds` use this to override the refresh rate of an individual tile (defaults to `300` seconds)

Examples
--------

[](#examples)

We have provided some chart factory examples to help get you started [here](examples). You can use the below dashboard layout to have an instant showcase of these examples:

```

```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email :author\_email instead of using the issue tracker.

Credits
-------

[](#credits)

- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/41698bb06c384e6d94e269250b5e47355250e7254adb617ee956f9a4a436e0b9?d=identicon)[Nguyễn Gia Hào](/maintainers/Nguy%E1%BB%85n%20Gia%20H%C3%A0o)

---

Top Contributors

[![dmason30](https://avatars.githubusercontent.com/u/20278756?v=4)](https://github.com/dmason30 "dmason30 (71 commits)")[![nggiahao1999](https://avatars.githubusercontent.com/u/40767596?v=4)](https://github.com/nggiahao1999 "nggiahao1999 (2 commits)")[![ConsoleTVs](https://avatars.githubusercontent.com/u/6124435?v=4)](https://github.com/ConsoleTVs "ConsoleTVs (1 commits)")

### Embed Badge

![Health badge](/badges/nggiahao-laravel-dashboard-chart-tile/health.svg)

```
[![Health](https://phpackages.com/badges/nggiahao-laravel-dashboard-chart-tile/health.svg)](https://phpackages.com/packages/nggiahao-laravel-dashboard-chart-tile)
```

###  Alternatives

[jrmadsen67/laravel-feature-test-generator

Cascading model updates for Laravel.

214.0k](/packages/jrmadsen67-laravel-feature-test-generator)[richardhj/contao-ajax_reload_element

AjaxReloadElement for Contao OpenSource CMS

144.2k](/packages/richardhj-contao-ajax-reload-element)

PHPackages © 2026

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