1. Go to this page and download the library: Download elemind/filament-echarts library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
elemind / filament-echarts example snippets
use Elemind\FilamentECharts\FilamentEChartsPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
FilamentEChartsPlugin::make()
]);
}
protected function isCollapsible(): bool
{
return true;
}
protected static ?int $contentHeight = 400; //px
protected function getContentHeight(): ?int
{
return 400;
}
protected static ?string $footer = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.';
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\View\View;
protected function getFooter(): null|string|Htmlable|View
{
return view('custom-footer', ['text' => 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.']);
}
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\View\View;
protected function getFooter(): null|string|Htmlable|View
{
return new HtmlString('<p class="text-danger-500">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>');
}
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;
use Filament\Widgets\ChartWidget\Concerns\HasFiltersSchema;
use Elemind\FilamentECharts\Widgets\EChartWidget;
class BlogPostsChart extends EChartWidget
{
use HasFiltersSchema;
public function filtersSchema(Schema $schema): Schema
{
return $schema->components([
TextInput::make('title')
->default('Blog Posts Chart'),
DatePicker::make('date_start')
->default('2025-07-01'),
DatePicker::make('date_end')
->default('2025-07-31'),
]);
}
/**
* Use this method to update the chart options when the filter form is submitted.
*/
public function updatedInteractsWithSchemas(string $statePath): void
{
$this->updateOptions();
}
}