Pure PHP API
Define everything in PHP — types, datasets, options, themes. No JavaScript scaffolding required for standard use cases.
Pure PHP API
Define everything in PHP — types, datasets, options, themes. No JavaScript scaffolding required for standard use cases.
Multi-Engine
Switch between ApexCharts and Chart.js with a single method call. Register your own engines via a stable adapter contract.
Livewire Native
Hooks into the v3/v4 lifecycle: morph protection, commit hydration, Alpine init/destroy. Charts react to property updates automatically.
Real-Time Polling
Chart::poll() + wire:poll + livecharts:refreshed event. Build live dashboards without writing a single line of JavaScript.
Artisan Ready
Scaffold chart classes with php artisan make:chart. Publish stubs, install assets, preview in browser — all from the CLI.
Production Tested
127 tests, 17 architecture rules, PHPStan level 8, ≥90% coverage gate, CI matrix across PHP 8.2-8.5 × Laravel 11/12/13 × Livewire 3/4.
use Matheusmarnt\LiveCharts\Facades\LiveCharts;
$chart = LiveCharts::line() ->title('Monthly Revenue') ->labels(['Jan', 'Feb', 'Mar', 'Apr']) ->dataset('Revenue', [12000, 19000, 15000, 22000]) ->colors(['#10B981']) ->pollEvery(30);namespace App\Charts;
use Matheusmarnt\LiveCharts\Charts\Chart;use Matheusmarnt\LiveCharts\Charts\Dataset;
class RevenueChart extends Chart{ protected string $type = 'line';
public function datasets(): array { return [ Dataset::make('Revenue') ->data([12000, 19000, 15000, 22000]) ->color('#10B981'), ]; }}<livewire:livecharts :chart="$chart" />
{{-- Or with a class-based chart --}}<livewire:livecharts :chart="App\Charts\RevenueChart::class" />| Stack | Versions |
|---|---|
| PHP | 8.2 · 8.3 · 8.4 · 8.5 |
| Laravel | 11 · 12 · 13 |
| Livewire | 3.6.4+ · 4.0+ |
| ApexCharts | ^5.10.6 |
| Chart.js | ^4.5.1 |