matheusmarnt/livecharts
LiveCharts is a reactive chart abstraction for Laravel using a pure PHP fluent API. Build 18 chart types and render via a single Livewire component. Supports ApexCharts and Chart.js with pluggable engines, enabling easy updates without JS boilerplate.
EngineAdapter contract, future-proofing for third-party integrations (e.g., Highcharts, ECharts).make:chart generator) or fluent builders, aligning with Laravel’s service-layer patterns. Reduces view clutter by offloading chart configuration to controllers/services.wire:poll) and broadcasting (Laravel Echo) further extend reactivity.composer require + php artisan livecharts:install (config, assets, optional stubs). No manual JavaScript configuration or build steps beyond Laravel’s default asset pipeline.<livewire:livecharts> component handles rendering, with asset directives (@liveChartsScripts) requiring placement before @livewireScripts. Supports both traditional Blade layouts and Livewire SPA navigation (wire:navigate).local, cdn, both) accommodate CI/CD pipelines, offline environments, or performance-optimized deployments. Vite-compatible for modern Laravel setups.->palette(TwPalette::Vibrant)) improves developer experience.public/vendor/livecharts/js/ files. Missing or corrupted assets cause silent failures (e.g., ApexCharts is not defined). Mitigation: Automate asset publishing in deployment scripts or enforce LIVECHARTS_ASSETS_MODE=cdn in production.EngineAdapter and handling engine-specific quirks (e.g., plugin dependencies). Risk mitigated by the package’s adapter pattern.Chart Complexity vs. Performance:
treemap or matrix?Multi-Tenancy:
broadcastOn) handle tenant isolation in shared environments (e.g., SaaS)? Are there race conditions with channel subscriptions?Customization Limits:
strokeDashArray) be exposed via the fluent API without extending the package?livecharts.js styles) handled in large projects?CI/CD Integration:
Fallback Behavior:
both mode?Long-Term Maintenance:
TwColor and TwPalette integrates seamlessly with Tailwind-themed apps. Dark mode switching is handled automatically.apexcharts.js, chartjs.js) work with Vite’s asset pipeline. Custom builds can extend livecharts.js via Vite plugins.Assessment Phase:
Pilot Integration:
$chart = LiveCharts::line()
->labels($this->getMonths())
->dataset('Revenue', $this->getRevenueData())
->colors(TwPalette::Vibrant->colors());
Incremental Rollout:
make:chart generator:
php artisan make:chart RevenueChart --type=line
<livewire:livecharts :chart="$chart" />.@liveChartsScripts) in layouts.Advanced Features:
$chart->poll(3000); // 3-second refresh
$chart->broadcastOn("private-charts.{$user->id}");
Deprecation:
dom, fileinfo).classList, fetch). Test in target browsers (e.g., Chrome 90+, Firefox 85+).Prerequisites:
Installation Order:
composer require matheusmarnt/livecharts.php artisan livecharts:install..env for asset mode (LIVECHARTS_ASSETS_MODE=both or cdn).Development Workflow:
php artisan make:chart {Name}.wire:poll and event listeners (onDataPointClick).Production Readiness:
LIVECHARTS_ASSETS_MODE=cdn).Rollback Plan:
public/vendor/livecharts/js/. Automate with:
php artisan vendor:publish --tag=livecharts-assets --force
both mode (e.g., jsDelivr uptime).How can I help you explore Laravel packages today?