PHPackages                             aldeebhasan/fast-bi - 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. aldeebhasan/fast-bi

ActiveLibrary

aldeebhasan/fast-bi
===================

This package will help you to add a fully customized widgets to your project

1.0.0(3y ago)240MITPHPPHP &gt;=8.0

Since Feb 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/aldeebhasan/fast-bi)[ Packagist](https://packagist.org/packages/aldeebhasan/fast-bi)[ RSS](/packages/aldeebhasan-fast-bi/feed)WikiDiscussions main Synced 1mo ago

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

Fast-Bi
-------

[](#fast-bi)

Fast-Bi is a light weight Business Intelligence dashboard manager for all php projects.

### Installation

[](#installation)

Install Fast-Bi using composer:

`composer require aldeebhasan/fast-bi`

### Requirements

[](#requirements)

Fast-Bi require php 8.0 or later versions. it can work on any platform that use php like laravel,codeigniter,symphony and so on.

Main features and concepts
--------------------------

[](#main-features-and-concepts)

Fast-Bi enable you to add different kind of widgets to your dashboard. The main component is `Widget`, which can use `Dimension`, `Metric`, or Raw arrays to fully customize the desired widget.

### Dimensions

[](#dimensions)

`Dimension` is a data container that can take any array as input, do some transformation and preparation over it in order to obtain the desired data. The `Dimension` can be considered as an axis for the charts, column for the table with predefined functionalities.

Kind of Dimensions:

- dateTime : transform the input to datetime format
- string : transform the input to strings
- number : transform the input to float format
- raw : transform the input to custom format

How to define a new dimension:

```
use Aldeebhasan\FastBi\Manager\Dimensions;
Dimensions::string('dimension-1',[1,2,4])->build();
Dimensions::number('dimension-2',[1,2,4])->build();
Dimensions::dateTime('dimension-3',['2023-5-5', '2024-6-6'])->build();

// to retrieve the dimension data you can use the `getData()` function.
$dimension = Dimensions::string('dimension-1',[1,2,4])->build();
print($dimension->getData())
//result = ["1","2","4"]//
```

The `dateTime` dimension accept a `format($format)` function to format the resulted data.

example:

```
$dimension = Dimensions::dateTime('dimension',['2023-5-5', '2024-6-6'])->format('Y-m')->build();
print($dimension->getData())
//result = ["2023-5","2024-6"]//
```

To build your custom dimension you can use the `raw` dimension as follow:
*Transformer will be applied over each item of the input array*

```
$dimension = Dimensions::raw('dimension', [1, 2, 3, 4])
            ->setTransformer(fn ($x) => $x - 1)
            ->build();
print($dimension->getData())
//result = [0, 1, 2, 3]//
```

### Metrics

[](#metrics)

`Metric` is a data container that can take any array as input and do some operation over it in order to obtain the desired metric. The `Metric` can mainly be used to show some statistics.

Kind of Metrics:

- sum : get the sum of the input data
- max : get the maximum value of the input data
- min : get the minimum value of the input data
- median : get the median value of the input data
- avg : get the average value of the input data
- raw : get custom value of the input data

How to define a new metric:

```
use Aldeebhasan\FastBi\Manager\Metrics;
Metrics::sum('metric-1',[1,2,3])->build();
Metrics::max('metric-2',[1,2,3])->build();
Metrics::min('metric-3',[1,2,3])->build();
Metrics::median('metric-4',[1,2,3])->build();
Metrics::avg('metric-5',[1,2,3])->build();

// to retrieve the metric data you can use the `getData()` function.
$metric = Metrics::sum('metric-1',[1,2,3])->build();
print($metric->getData())
//result = 6//
```

To build your custom metric you can use the `raw` metric as follow:
*Transformer will be applied over each item of the input array*

```
$metric = Metrics::raw('name', [1, 2, 3])
->setMeasure(fn ($data) => count($data))
->build();
print($metric->getData())
//result = 3//
```

### Widgets

[](#widgets)

The most important component of this package is the `Widgets`. Many type of widgets are predefined for you.

Each `Widget` has three main parts:

- labels : to customize the column name for table or the axis names, ..etc
- dimensions : to define the data you want to show or plot
- metrics : to show some statistics at the bottom of each widget

#### `Table Widgets`

[](#table-widgets)

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

Widgets::table('users')
        ->labels(['ID', 'Name', 'mobile'])
        ->dimensions([
            Dimensions::number('ids',[1,2,3]),
            'names'=>['Ali', 'Hasan', 'Mohammad'],
            'mobile'=>Dimensions::string('mob',["+01252**","+01252**","+01252**"]),
        ])->render()
//with metrics
Widgets::table('users')
        ->labels(['ID', 'Name', 'mobile'])
        ->dimensions([
            Dimensions::number('ids',[1,2,3]),
            'names'=>['Ali', 'Hasan', 'Mohammad'],
            'mobile'=>Dimensions::string('mob',["+01252**","+01252**","+01252**"]),
        ])->metrics([
            Metrics::count('total',[1,2,4]),
            'average'=>Metrics::avg('avg',[1,2,4])
        ])->render()
```

DefaultWith metrics[![Table Widgets](./snapshots/table.png)](./snapshots/table.png)[![Table Widgets Metrics](./snapshots/table-metrics.png)](./snapshots/table-metrics.png)#### `Bar Chart Widgets`

[](#bar-chart-widgets)

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

Widgets::barChart('profits')
        ->labels(['2016', '2017', '2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,200,300]),
            'store-invoices'=>[150,110,250],
            Dimensions::number('extra',[10,20,30]),
        ])->metrics([
            Metrics::sum('total',[100,200,300]),
            'max-income'=>Metrics::max('avg',[100,200,300]),
            'min-income'=>Metrics::min('avg',[100,200,300])
        ])->render()

//To make the bar chart horizontal, you can just add the following settings to the widget:
Widgets::barChart('profits')
        ->labels(['2016', '2017', '2018'])
        ->settings(['direction'=>'y'])   //// make the y axis as the base
        ->dimensions([
            Dimensions::number('pos-invoices',[100,200,300]),
            'store-invoices'=>[150,110,250],
            Dimensions::number('extra',[10,20,30]),
        ])->metrics([
            Metrics::sum('total',[100,200,300]),
            'max-income'=>Metrics::max('avg',[100,200,300]),
            'min-income'=>Metrics::min('avg',[100,200,300])
        ])->render()
```

Vertical(default)Horizontal[![Table Widgets](./snapshots/bar-chart.png)](./snapshots/bar-chart.png)[![Table Widgets](./snapshots/bar-chart-h.png)](./snapshots/bar-chart-h.png)#### `Line Chart Widgets`

[](#line-chart-widgets)

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

Widgets::lineChart('profits')
        ->labels(['2016', '2017', '2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,200,300]),
            'store-invoices'=>[150,110,250],
            Dimensions::number('extra',[10,20,30]),
        ])->render()

//with metrics
Widgets::lineChart('profits')
        ->labels(['2016', '2017', '2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,200,300]),
            'store-invoices'=>[150,110,250],
            Dimensions::number('extra',[10,20,30]),
        ])->metrics([
            Metrics::sum('total',[100,200,300]),
            'max-income'=>Metrics::max('avg',[100,200,300]),
            'min-income'=>Metrics::min('avg',[100,200,300])
        ])->render()
```

DefaultWith metrics[![Line chart Widgets](./snapshots/line-chart.png)](./snapshots/line-chart.png)[![Line chart Widgets Metric](./snapshots/line-chart-metric.png)](./snapshots/line-chart-metric.png)#### `Pie Chart Widgets`

[](#pie-chart-widgets)

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

Widgets::pieChart('profits')
        ->labels(['2016', '2017', '2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,200,300]),
            'store-invoices'=>[150,110,250],
            Dimensions::number('extra',[10,20,30]),
        ])->render()

 Widgets::pieChart('profits of pos')
        ->labels(['2016', '2017', '2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,200,300]),
        ])->render()
```

Single DimensionMulti Dimensions[![Pie Widgets](./snapshots/pie-chart-single.png)](./snapshots/pie-chart-single.png)[![Pie Widgets Single](./snapshots/pie-chart.png)](./snapshots/pie-chart.png)#### `Doughnut Chart Widgets`

[](#doughnut-chart-widgets)

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

Widgets::doughnutChart('profits')
        ->labels(['2016', '2017', '2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,200,300]),
            'store-invoices'=>[150,110,250],
            Dimensions::number('extra',[10,20,30]),
        ])->render()

 Widgets::doughnutChart('profits of pos')
        ->labels(['2016', '2017', '2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,200,300]),
        ])->render()
```

Single DimensionMulti Dimensions[![Doughnut Widgets](./snapshots/doughnut-chart-single.png)](./snapshots/doughnut-chart-single.png)[![Doughnut Widgets Single](./snapshots/doughnut-chart.png)](./snapshots/doughnut-chart.png)#### `Scatter Chart Widgets` &amp; `Bubble Chart Widgets`

[](#scatter-chart-widgets--bubble-chart-widgets)

These two chart are very similar to each other. The main difference is that the bubble chart will have a different radius for each data point.

The default behaviour of these two charts is to make the first dimension is the base dimension which will be combined with all the other dimensions.

**In the following example `pos-invoices` will be combined with `store-invoices` and then with `extra` accordingly**

If the labels are not defined, the package will combine the dimensions names to make a suitable naming for each dataset.

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

Widgets::scatterChart('profits')
        ->labels(['POS To Store','POS to Extra'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,110,120,130,140,160,200,250]),
            Dimensions::number('store-invoices',[100,200,300,210,300,400,450,600]),
            Dimensions::number('extra',[10,20,30,80,90,150,200,250]),
        ])->render()

Widgets::bubbleChart('bubbles profits')
        ->labels(['POS To Store','POS to Extra'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,110,120,130,140,160,200,250]),
            Dimensions::number('store-invoices',[100,200,300,210,300,400,450,600]),
            Dimensions::number('extra',[10,20,30,80,90,150,200,250]),
        ])->render()
```

Scatter chartBubble chart[![Scatter Widgets](./snapshots/scatter-chart.png)](./snapshots/scatter-chart.png)[![Bubble Widgets](./snapshots/bubble-chart.png)](./snapshots/bubble-chart.png)#### `Polar Area Chart Widgets`

[](#polar-area-chart-widgets)

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};
//single dimension
Widgets::polarAreaChart('polar profits')
        ->labels(['2016 ','2017','2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[100,110,120]),
        ])->render()
//multi dimensions
Widgets::polarAreaChart('polar profits (multi)')
         ->labels(['2016 ','2017','2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[125,110,120]),
            Dimensions::number('store-invoices',[100,150,175]),
            Dimensions::number('extra',[150,110,150]),
        ])->render()
```

Single DimensionMulti Dimensions[![Polar Widgets](./snapshots/polar-chart.png)](./snapshots/polar-chart.png)[![Polar Widgets Multi](./snapshots/polar-chart-multi.png)](./snapshots/polar-chart-multi.png)#### `Radar Chart Widgets`

[](#radar-chart-widgets)

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

//single dimension
 Widgets::radarChart('radar profits')
         ->labels(['2016 ','2017','2018','2019',2020])
        ->dimensions([
            Dimensions::number('pos-invoices',[125,150,180,190,200]),
        ])->render()
//multi dimensions
Widgets::radarChart('radar profits (multi)')
         ->labels(['2016 ','2017','2018'])
        ->dimensions([
            Dimensions::number('pos-invoices',[125,110,120]),
            Dimensions::number('store-invoices',[100,150,175]),
            Dimensions::number('extra',[150,110,150]),
        ])->render()
```

Single DimensionMulti Dimensions[![Polar Widgets](./snapshots/radar-chart.png)](./snapshots/radar-chart.png)[![Polar Widgets Multi](./snapshots/radar-chart-multi.png)](./snapshots/radar-chart-multi.png)#### `Number Widgets`

[](#number-widgets)

This widget is used to represent some statistic related to your dashboard.

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

//single dimension
 Widgets::number('expenses')
        ->labels(['Maintenance Expenses'])
        ->dimensions([
            Dimensions::number('maintainance',[250]),
        ])->render()
//multi dimensions
Widgets::number('incomes')
        ->dimensions([
             Dimensions::number('orders',[100000]),
             Dimensions::number('marketing',[1500]),
            'social-media' => 6000
        ])->render()
```

SingleMulti[![Number Widgets](./snapshots/number-2.png)](./snapshots/number-2.png)[![Number Widgets Multi](./snapshots/number.png)](./snapshots/number.png)#### `ProgressBar Widgets`

[](#progressbar-widgets)

This widget is used to represent some statistic related to your dashboard. **For this widget, you should specify numbers in term of percentage (max is 100 and min 0)**

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

//single dimension
 Widgets::progressBar('expenses')
        ->labels(['Maintenance Expenses'])
        ->dimensions([
            Dimensions::number('maintainance',[250]),
        ])->render()
//multi dimensions
Widgets::progressBar('incomes')
        ->dimensions([
             Dimensions::number('orders',[100000]),
             Dimensions::number('marketing',[1500]),
            'social-media' => 6000
        ])->render()
```

SingleMulti[![ProgressBar Widgets](./snapshots/progress-bar.png)](./snapshots/progress-bar.png)[![ProgressBar Widgets Multi](./snapshots/progress-bar-2.png)](./snapshots/progress-bar-2.png)#### `Geo Map Widgets`

[](#geo-map-widgets)

For this widget you need to specify the countries you want to show the statistics on. You can define the country using the iso2 code.

```
use Aldeebhasan\FastBi\Manager\{Metrics,Dimensions,Widgets};

//single dimension
 Widgets::geoMap('map')
        ->countries(['US','CA','FR','CN'])
        ->dimensions([
            Dimensions::number('population',['150','200','300','400']),
            'area'=>['1500','2000','3000','6000'],
        ])->render()
//custom names
 Widgets::geoMap('map')
        ->countries(['US','CA','FR','CN'])
         ->labels(['Population','Square Area'])
        ->dimensions([
            Dimensions::number('population',['150','200','300','400']),
            'area'=>['1500','2000','3000','6000'],
        ])->render()
```

DefaultCustomized[![ProgressBar Widgets](./snapshots/geo-map-2.png)](./snapshots/geo-map-2.png)[![ProgressBar Widgets Multi](./snapshots/geo-map.png)](./snapshots/geo-map.png)License
-------

[](#license)

Fast-Bi package is licensed under [The MIT License (MIT)](https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt).

Security contact information
----------------------------

[](#security-contact-information)

To report a security vulnerability, contact directly to the developer contact email [Here](mailto:aldeeb.91@gmail.com).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

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

1176d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/74e7b9d93b0f666f462ad0be43dde05991e9d141f9fe840009775808107d440e?d=identicon)[aldeebhasan](/maintainers/aldeebhasan)

---

Top Contributors

[![aldeebhasan](https://avatars.githubusercontent.com/u/62222392?v=4)](https://github.com/aldeebhasan "aldeebhasan (2 commits)")

---

Tags

bichartscustum-widgetlaravelphpreportsstatisticstablewidgetslaravelwidgetschartsreportscustomized-widgets

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aldeebhasan-fast-bi/health.svg)

```
[![Health](https://phpackages.com/badges/aldeebhasan-fast-bi/health.svg)](https://phpackages.com/packages/aldeebhasan-fast-bi)
```

###  Alternatives

[sakanjo/laravel-easy-metrics

Generate metrics with ease and precision.

31942.6k1](/packages/sakanjo-laravel-easy-metrics)[digital-creative/nova-dashboard

The missing dashboard for nova.

7169.3k1](/packages/digital-creative-nova-dashboard)[renoki-co/php-helm

PHP Helm Processor is a process wrapper for Kubernetes' Helm v3 CLI. You can run programmatically Helm v3 commands, directly from PHP, with a simple syntax.

1310.5k](/packages/renoki-co-php-helm)

PHPackages © 2026

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