PHPackages                             apapazisis/laravel-echarts - 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. apapazisis/laravel-echarts

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

apapazisis/laravel-echarts
==========================

Laravel Echarts

v1.4(6y ago)8379↓85.7%1MITPHPPHP &gt;=7.0

Since May 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/apapazisis/laracharts)[ Packagist](https://packagist.org/packages/apapazisis/laravel-echarts)[ RSS](/packages/apapazisis-laravel-echarts/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

Laravel Ajax Charts with WebWorker
----------------------------------

[](#laravel-ajax-charts-with-webworker)

[![Codacy Badge](https://camo.githubusercontent.com/772e8a23a68663450dc2051a7d92385ce698fc13b6c1930505fcbce997a89084/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3937646130393939616661383465353461646134366231636162633865653763)](https://app.codacy.com/app/apapazisis/laracharts?utm_source=github.com&utm_medium=referral&utm_content=apapazisis/laracharts&utm_campaign=Badge_Grade_Dashboard)[![StyleCI](https://camo.githubusercontent.com/d317471df8d757a014a5ebe0530ada2b53a8151112fb3edbfa26e4bb53bc7146/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3138393431333137322f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/189413172)[![Latest Stable Version](https://camo.githubusercontent.com/83465914940053031478c1fcc0f808ba1a4fb98813180b1bfeaacd86046e8358/68747470733a2f2f706f7365722e707567782e6f72672f61706170617a697369732f6c61726176656c2d656368617274732f762f737461626c65)](https://packagist.org/packages/apapazisis/laravel-echarts)[![License](https://camo.githubusercontent.com/8e5b331e020cb750ed833ea578ea7c702fa391e9b4747b2af2341fcd442c8f1c/68747470733a2f2f706f7365722e707567782e6f72672f61706170617a697369732f6c61726176656c2d656368617274732f6c6963656e7365)](https://packagist.org/packages/apapazisis/laravel-echarts)

### What is Laravel Echarts?

[](#what-is-laravel-echarts)

Generate your Charts using **Laravel Echarts PHP library**. It supports the [Echarts.js library](https://ecomfe.github.io/echarts-doc/public/en/tutorial.html#Get%20Started%20with%20ECharts%20in%205%20minutes). Charts are loaded through WebWorker in the background, independently of user-interface scripts and without affecting the performance of the page.

### Documentation

[](#documentation)

1. Publish the files through

```
php artisan vendor:publish
Provider: Apapazisis\Echarts\EchartsServiceProvider
```

2. Add scripts in header

```

```

3. Routing

```
Route::get('/', function ()
{
   $testChart = new \App\Charts\TestChart();

   $testChart2 = new \App\Charts\Test2Chart();

   return view('welcome', compact('testChart', 'testChart2'));
});

Route::post('/data', function (\Illuminate\Http\Request $request)
{
   $class = 'App\\Charts\\' . $request->get('chartClass');
   $chart = (new $class)->make($request->except('chartClass'));

   return response()->json(
         $chart->get()
   );
});
```

4. Blade

```

             {!! $testChart->render() !!}
             {!! $testChart2->render() !!}
             1o
             2o

```

4. TestChart Class

```
 namespace App\Charts;

 use Apapazisis\Echarts\Classes\BaseChart;
 use Carbon\Carbon;

 class TestChart extends BaseChart
 {
   public $id = 'kjdshksdjfsjdfg';

   protected $date = null; // it is used for filtering

   protected $data = [];

   public function __construct()
   {
       $this->setRoute(); // Set the route
       parent::__construct();
   }

   public function make($filters = [])
   {
       return $this
           ->setFilters($filters) // first we set the filters and then we can use them wherever we want in other functions
           ->setData()
           ->setOptions()
           ->setDataset()
           ;
   }

   public function setData()
   {
       if (isset($this->date)){
           $i = 25;
       } else {
           $i = 10;
       }

       $this->data['mailsentdates'] = [$i, 20, 30];
       $this->data['accessclearingdate'] = [3, 6, 9];

       return $this;
   }

   public function setDataset()
   {
       $this->dataset('Sales1', 'bar', $this->data['mailsentdates'])->options([
           'itemStyle' => [
               'normal' => [
                   'color' => 'function (params){console.log(params);if (params.dataIndex > 0) return "red"; else return "green";}',
                   'barBorderColor' => 'gray',
                   'barBorderWidth' => 0,
                   'label' => [
                       'show' => true,
                       'position' => 'top',
                       'textStyle' => [
                           'fontWeight' => 500
                       ],
                       'color' => 'gray',
                       'formatter' => 'function(params){var array = ' . json_encode($this->data['mailsentdates']) . '; return params.data + array[params.dataIndex];}'

                   ]
               ]
           ]
       ]);

       $this->dataset('Sales2', 'bar', $this->data['accessclearingdate'])->options([
           'itemStyle' => [
               'normal' => [
                   'color' => 'function (params){console.log(window.' . $this->id . 'Options);if (params.dataIndex > 0) return "yellow"; else return "blue";}',
                   'barBorderColor' => 'gray',
                   'barBorderWidth' => 0,
                   'label' => [
                       'show' => true,
                       'position' => 'top',
                       'textStyle' => [
                           'fontWeight' => 500
                       ],
                       'color' => 'gray'
                   ]
               ]
           ]
       ]);

       return $this;
   }

   public function setOptions()
   {
       if (isset($this->date)) {
           $data = ['apos', 'xlbl2', 'xlbl3'];
        } else {
           $data = ['xlbl1', 'xlbl2', 'xlbl3'];
       }

       $this->options([
           'title' => [
               'text' => 'The title',
               'show' => true
           ],
           'tooltip' => [
               'trigger' => 'axis',
               'axisPointer' => [
                   'type' => 'cross'
               ]
           ],
           'toolbox' => [
                 'feature' => [
                     'saveAsImage' => [
                         'show' => true,
                         'title' => 'save as image',
                         'pixelRatio' => 2
                     ]
                 ]
           ],
           'animationEasing' => 'elasticOut',
           'legend' => [
               'data' => ['Sales1', 'Sales2']
           ],
           'xAxis' => [
               'type' => 'category',
               'data' => $data
           ],
           'yAxis' => [
               'type' => 'value'
           ],
           'grid' => [
               'left' => '0%',
               'right' => '0%',
               'bottom' => '0%',
               'containLabel' => true
           ]
       ]);

       return $this;
   }

   public function setRoute()
   {
       $this->route = url('data');

       return $this;
   }

   public function setFilters($filters)
   {
       $this->date = isset($filters['date']) ? Carbon::parse($filters['date'])->startOfWeek() : null;

       return $this;
   }
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.5% 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 ~5 days

Total

5

Last Release

2525d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/235b108f222e4bdaf00adb250244c2677a96e9ac4c9ab17d04956be6b1a04f39?d=identicon)[apapazisis](/maintainers/apapazisis)

---

Top Contributors

[![apapazisis](https://avatars.githubusercontent.com/u/13486500?v=4)](https://github.com/apapazisis "apapazisis (52 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (3 commits)")

---

Tags

ajaxechartslaravelwebworker

### Embed Badge

![Health badge](/badges/apapazisis-laravel-echarts/health.svg)

```
[![Health](https://phpackages.com/badges/apapazisis-laravel-echarts/health.svg)](https://phpackages.com/packages/apapazisis-laravel-echarts)
```

###  Alternatives

[alleyinteractive/wp-bulk-task

A library to assist with running performant bulk tasks against WordPress objects.

21326.8k4](/packages/alleyinteractive-wp-bulk-task)

PHPackages © 2026

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