Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Nova Bar Metrics

Nova Bar Metrics Laravel Package

insenseanalytics/nova-bar-metrics

A Laravel Nova package that adds a bar chart metric card for visualizing trends and comparisons on your dashboard. Display metric values as clean, responsive bars with customizable labels, colors, and formatting for at-a-glance reporting.

View on GitHub
Deep Wiki
Context7

Nova Bar Metrics provides a clean, responsive bar chart metric card for Laravel Nova dashboards. It lets you visualize and compare grouped values with labeled horizontal bars, making key metrics easier to scan than plain numbers.

  • Drop-in Nova metric card for dashboards and resources
  • Horizontal bars with labels for quick comparison
  • Define metric data in PHP via a simple API
  • Responsive, Nova-native styling
  • Works with standard Nova metric caching
Frequently asked questions about Nova Bar Metrics
How do I install insenseanalytics/nova-bar-metrics in a Laravel Nova app?
Require the package with Composer, but first make sure your machine or CI runner is authenticated against Nova's private repository at nova.laravel.com. Then register the metric card in your Nova dashboard or resource. Because the package ships a compiled Vue 2 card and a service provider that registers assets, you may also need to publish assets depending on your setup. The decisive check is Composer resolution: the published constraints target Laravel 5.6/5.7 and PHP 7.1/7.2, so expect require to fail on newer stacks.
Which Laravel, PHP and Nova versions does Nova Bar Metrics support?
The package was built for the Nova 1.x era: Laravel 5.6/5.7, PHP 7.1/7.2, Vue 2 and Laravel Mix. It renders inside Nova's metric endpoint, so it needs a Nova install old enough to load Mix-era compiled assets. On Nova 3+, PHP 8.x or Laravel 9+ Composer will refuse to resolve without widening constraints, and widening them does not fix the runtime.
Why does composer require fail for nova-bar-metrics on a modern Laravel app?
That is expected. The declared constraints predate modern Laravel and PHP, so the resolver rejects the install on current stacks. Nova itself lives in a private Composer repository, so every CI runner, container build and new developer machine also needs nova.laravel.com credentials before any spike can start. Widening the constraints gets you past the resolver but not past the runtime, because the compiled Vue 2 card will not load in Nova 4+.
How do I define the data shown in a Nova bar metric card?
You extend the package's metric class and implement calculate(Request $request), returning a simple label-to-value array such as ticket statuses or order value buckets mapped to counts. The card only renders what you return, so the aggregation is your own GROUP BY query and no external API, queue or extra datastore is introduced. That keeps the blast radius small but also means filtering and date scoping remain your responsibility.
Can I customize the labels, colors and number formatting of the bars?
The card renders horizontal bars with labels using Nova-native styling, and the package advertises customizable labels, colors and formatting. Because there has been no release since December 2018, read the compiled Vue component and the PHP metric class end to end before depending on a specific option. Anything beyond what the card exposes means editing the component, which is feasible given the code is small and MIT licensed.
Does Nova Bar Metrics work with standard Nova metric caching?
Yes. It works with standard Nova metric caching, so cacheFor on your metric behaves as it does for any other Nova card. Caching is handled by Nova's Metric base class rather than by the package, so the card simply displays whatever snapshot the endpoint returns. Keep in mind the underlying query cost still depends on the row count behind your GROUP BY.
What metrics are a good fit for Nova Bar Metrics, and how does it compare to Partition or Trend?
It fits exactly one shape: a horizontal categorical frequency distribution such as tickets by status, orders by value bucket or users by plan tier. Native Partition metrics cover similar categorical comparisons, and Trend with showValues is the right tool for movement over time. This package has no date-range filter, click-through, export or cross-period comparison, so treat those as separate roadmap items rather than implied features.
Will Nova Bar Metrics work on Nova 4 or Nova 5?
No, not without a rewrite. Nova 4+ moved to Inertia and Vue 3 with a revised asset pipeline, so Mix-era compiled assets will not load and the Nova::script and Nova::style registration semantics have shifted. The sane path is to treat the repository as a reference implementation and reimplement the same pattern, one Metric subclass plus a small card, against your actual Nova version. That is roughly a day of engineering, not a small patch.
Is Nova Bar Metrics maintained and safe to use in production?
Treat it as unmaintained: the last release was December 2018, it has around 40 stars, zero dependents, a single publisher, no CI and no commits in roughly seven years. There will be no security advisory and no compatibility patch, and Nova's commercial support does not extend to third-party tools. The compensating control is that the code is small enough to read end to end in one sitting and MIT licensed, so fork and own it if you adopt it. If anyone is making a budget or staffing decision off this card, an unmaintained dependency is the wrong substrate.
Should I fork Nova Bar Metrics or require it directly, and how do I evaluate it first?
Run a half-day throwaway-branch spike first, because feasibility here is binary and cheap to answer. Confirm the target app's Nova major and PHP version, get nova.laravel.com credentials into CI and containers, and check whether the requirement is already expressible as a native Partition card or a stacked Trend. If you proceed, fork before you require, never patch vendor, pin per application when the fleet runs mixed Nova majors, and record the MIT attribution.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console