PHPackages                             insenseanalytics/nova-bar-metrics - 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. insenseanalytics/nova-bar-metrics

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

insenseanalytics/nova-bar-metrics
=================================

A Laravel Nova tool for bar chart metrics and frequency distributions.

v1.0.2(7y ago)41125.2k↓27.6%2[1 PRs](https://github.com/insenseanalytics/nova-bar-metrics/pulls)MITPHPPHP &gt;=7.1.0

Since Aug 25Pushed 3y ago2 watchersCompare

[ Source](https://github.com/insenseanalytics/nova-bar-metrics)[ Packagist](https://packagist.org/packages/insenseanalytics/nova-bar-metrics)[ RSS](/packages/insenseanalytics-nova-bar-metrics/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

A Laravel Nova tool for bar chart metrics and frequency distributions
=====================================================================

[](#a-laravel-nova-tool-for-bar-chart-metrics-and-frequency-distributions)

[![License](https://camo.githubusercontent.com/1b16a42b24095f473baffa1bed325094d58a28161d5a99204061269365573bbf/68747470733a2f2f706f7365722e707567782e6f72672f696e73656e7365616e616c79746963732f6e6f76612d6261722d6d6574726963732f6c6963656e7365)](https://packagist.org/packages/insenseanalytics/nova-bar-metrics)[![Latest Stable Version](https://camo.githubusercontent.com/ed050c6c06243845e56bb4fe5cee5c8ae9683f4b7e5a16217ad1412f8c617761/68747470733a2f2f706f7365722e707567782e6f72672f696e73656e7365616e616c79746963732f6e6f76612d6261722d6d6574726963732f762f737461626c65)](https://packagist.org/packages/insenseanalytics/nova-bar-metrics)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/75722dc0179e0f636dfd7f24cd1c6231cd47bb22331af3a74cabae15f70dfa5c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f696e73656e7365616e616c79746963732f6e6f76612d6261722d6d6574726963732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/insenseanalytics/nova-bar-metrics/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/60378526c655a3715afacd74f470e1c140bf40058ab9880c6580ae3e13a50839/68747470733a2f2f706f7365722e707567782e6f72672f696e73656e7365616e616c79746963732f6e6f76612d6261722d6d6574726963732f646f776e6c6f616473)](https://packagist.org/packages/insenseanalytics/nova-bar-metrics)[![Monthly Downloads](https://camo.githubusercontent.com/0995e88da1e65576ab6281cd32b71b06617ca2b5976e5e957b88074347bcea27/68747470733a2f2f706f7365722e707567782e6f72672f696e73656e7365616e616c79746963732f6e6f76612d6261722d6d6574726963732f642f6d6f6e74686c79)](https://packagist.org/packages/insenseanalytics/nova-bar-metrics)

This [Nova](https://nova.laravel.com) tool lets you:

- create bar charts
- create frequency distribution charts (using pie charts and/or bar charts)

Bar Chart Metric Screenshot
---------------------------

[](#bar-chart-metric-screenshot)

[![screenshot of the backup tool](https://camo.githubusercontent.com/9346171d9befe3d2d7c56d28dc09c1261b7e3606c4e19dced71b2b81beeee65b/68747470733a2f2f696e73656e7365616e616c79746963732e6769746875622e696f2f7075626c69632d6173736574732f6e6f76612d6261722d6d6574726963732f6e6f76612d6261722d6d6574726963732d626172312e706e67)](https://camo.githubusercontent.com/9346171d9befe3d2d7c56d28dc09c1261b7e3606c4e19dced71b2b81beeee65b/68747470733a2f2f696e73656e7365616e616c79746963732e6769746875622e696f2f7075626c69632d6173736574732f6e6f76612d6261722d6d6574726963732f6e6f76612d6261722d6d6574726963732d626172312e706e67)

Frequency Distribution Metric Screenshot (Bar Chart)
----------------------------------------------------

[](#frequency-distribution-metric-screenshot-bar-chart)

[![screenshot of the backup tool](https://camo.githubusercontent.com/3cd433771fc3fdcefd7ad6a1c27445f69cd04659af9d98dd317dae386c4ef7a9/68747470733a2f2f696e73656e7365616e616c79746963732e6769746875622e696f2f7075626c69632d6173736574732f6e6f76612d6261722d6d6574726963732f6e6f76612d6261722d6d6574726963732d667265712d626172322e706e67)](https://camo.githubusercontent.com/3cd433771fc3fdcefd7ad6a1c27445f69cd04659af9d98dd317dae386c4ef7a9/68747470733a2f2f696e73656e7365616e616c79746963732e6769746875622e696f2f7075626c69632d6173736574732f6e6f76612d6261722d6d6574726963732f6e6f76612d6261722d6d6574726963732d667265712d626172322e706e67)

Frequency Distribution Metric Screenshot (Pie Chart)
----------------------------------------------------

[](#frequency-distribution-metric-screenshot-pie-chart)

[![screenshot of the backup tool](https://camo.githubusercontent.com/79c342956ea6949a7b26df3e3f70cfe3dbb17b45728d85d9ceda9a3f7efbfe69/68747470733a2f2f696e73656e7365616e616c79746963732e6769746875622e696f2f7075626c69632d6173736574732f6e6f76612d6261722d6d6574726963732f6e6f76612d6261722d6d6574726963732d667265712d7069652e706e67)](https://camo.githubusercontent.com/79c342956ea6949a7b26df3e3f70cfe3dbb17b45728d85d9ceda9a3f7efbfe69/68747470733a2f2f696e73656e7365616e616c79746963732e6769746875622e696f2f7075626c69632d6173736574732f6e6f76612d6261722d6d6574726963732f6e6f76612d6261722d6d6574726963732d667265712d7069652e706e67)

Bar Chart Metrics
-----------------

[](#bar-chart-metrics)

For a bar chart metric, just create a metric class like you normally would for a `Partition` metric. All the available methods in a `Partition` metric are also available for `BarChartMetric`! Instead of extending `Partition` you would just need to extend `BarChartMetric` like so:

```
use Insenseanalytics\NovaBarMetrics\BarChartMetric;

class BrandsPerCategory extends BarChartMetric
{
  public function calculate(Request $request)
  {
    return $this->count($request, BrandCategory::class, 'category_name');
  }
}
```

You can also use the `suffix`, `prefix`, `dollars` and `euros` methods like in a `TrendMetric` in Laravel Nova. Besides this, we also have a `precision` method to set the precision of the `avg` metric shown in the top right corner of the bar chart.

Frequency Distributions for Bar Chart Metrics and Partition Metrics
-------------------------------------------------------------------

[](#frequency-distributions-for-bar-chart-metrics-and-partition-metrics)

To create a frequency distributions chart, either extend the `BarChartMetric` class or extend the `Partition` class and use the trait `HasFrequencyDistributions`. You can use the `distributions` helper method to create the frequency distribution chart like so:

***Example for BarChartMetric***

```
use Insenseanalytics\NovaBarMetrics\BarChartMetric;

class BrandFacebookFollowers extends BarChartMetric
{
  public function calculate(Request $request)
  {
    return $this->distributions($request, Brand::class, 'facebook_followers', 100000);
  }
}
```

In the example above, 100000 is the `step size` to use for the ranges in the frequency distribution and facebook\_followers is the `column to distribute` by ranges.

Instead of providing the `step size`, you may provide the max number of steps instead using the `distributionsWithSteps` method and the package would automatically calculate the step size like so:

```
use Insenseanalytics\NovaBarMetrics\BarChartMetric;

class BrandFacebookFollowers extends BarChartMetric
{
  public function calculate(Request $request)
  {
    return $this->distributionsWithSteps($request, Brand::class, 'facebook_followers', 15);
  }
}
```

For friendly formatted ranges (K for thousands, M for millions, B for billions), you can use the `withFormattedRangeLabels` method like so:

```
public function calculate(Request $request)
{
  return $this->distributions($request, Brand::class, 'facebook_followers', 100000)
              ->withFormattedRangeLabels();
}
```

***Example for Partition Metric***

```
use Laravel\Nova\Metrics\Partition;
use Insenseanalytics\NovaBarMetrics\HasFrequencyDistributions;

class BrandFacebookFollowers extends Partition
{
  use HasFrequencyDistributions;

  public function calculate(Request $request)
  {
    return $this->distributions($request, Brand::class, 'facebook_followers', 100000);
  }
}
```

Requirements &amp; Dependencies
-------------------------------

[](#requirements--dependencies)

There are no PHP dependencies except the Laravel Nova package. On the frontend JS, this package uses `vue`, `chartist`, `chartist-plugin-tooltips` and `laravel-nova`, all of which are also used by Nova itself.

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

[](#installation)

You can install this tool into a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require insenseanalytics/nova-bar-metrics
```

Next, if you do not have package discovery enabled, you need to register the provider in the `config/app.php` file.

```
'providers' => [
    ...,
    Insenseanalytics\NovaBarMetrics\NovaBarMetricsServiceProvider::class,
]
```

Usage
-----

[](#usage)

You can use the console command `php artisan nova:barmetric ` to create new BarMetric classes

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

[](#contributing)

Contributions are welcome and will be fully credited as long as you use PSR-2, explain the issue/feature that you want to solve/add and back your code up with tests. Happy coding!

License
-------

[](#license)

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

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.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 ~56 days

Total

3

Last Release

2710d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3b4395cbe0ac91e6c75a298f834f347905a340bd030e5f2046249a341569fee?d=identicon)[paras-malhotra](/maintainers/paras-malhotra)

---

Top Contributors

[![paras-malhotra](https://avatars.githubusercontent.com/u/16099046?v=4)](https://github.com/paras-malhotra "paras-malhotra (23 commits)")[![jrmadsen67](https://avatars.githubusercontent.com/u/821958?v=4)](https://github.com/jrmadsen67 "jrmadsen67 (3 commits)")

---

Tags

laravellaravel-novalaravelnovabar-chartfrequency distributions

### Embed Badge

![Health badge](/badges/insenseanalytics-nova-bar-metrics/health.svg)

```
[![Health](https://phpackages.com/badges/insenseanalytics-nova-bar-metrics/health.svg)](https://phpackages.com/packages/insenseanalytics-nova-bar-metrics)
```

###  Alternatives

[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3403.5M7](/packages/optimistdigital-nova-multiselect-field)[digital-creative/conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.

116593.8k4](/packages/digital-creative-conditional-container)[genealabs/laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.

92398.0k2](/packages/genealabs-laravel-overridable-model)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

51174.8k1](/packages/inspheric-nova-defaultable)[murdercode/nova4-tinymce-editor

Boost your Laravel Nova with the TinyMCE editor.

17165.2k](/packages/murdercode-nova4-tinymce-editor)[yieldstudio/nova-google-autocomplete

A Laravel Nova Google autocomplete field.

12218.4k](/packages/yieldstudio-nova-google-autocomplete)

PHPackages © 2026

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