F
Filament4mo ago
buhack

widget

hey guys i want to create a dashboard. When i try to load 4 stats as colspan:12 and 1 chart as colspan:8 and 1 more stat after chart as colspan:4 they are not matching as the screenshot shows. Have a nice day!
No description
2 Replies
shine
shine4mo ago
could you show me your code?
buhack
buhackOP4mo ago
first 4 stats in one widget
protected static ?int $sort = 1;

protected int|string|array $columnSpan = 12;

protected function getStats(): array
{
return [
Stat::make('Kalan randevu (Bugün)', 0),
Stat::make('Toplam randevu (Bugün)', 0),
Stat::make('Tamamlanan randevu (Bugün)',0),
Stat::make('İptal edilen randevu (Bugün)',0),
];
}
protected static ?int $sort = 1;

protected int|string|array $columnSpan = 12;

protected function getStats(): array
{
return [
Stat::make('Kalan randevu (Bugün)', 0),
Stat::make('Toplam randevu (Bugün)', 0),
Stat::make('Tamamlanan randevu (Bugün)',0),
Stat::make('İptal edilen randevu (Bugün)',0),
];
}
second chart on center
protected static ?int $sort = 2;

protected int|string|array $columnSpan = 8;

protected static ?string $heading = 'Son bir ayın istatistiği';

protected static ?string $maxHeight = '370px';


protected function getData(): array
{
return [
'datasets' => [
[
'label' => 'Kontrol edilen danışan sayısı',
'data' => [0, 10, 5, 2, 21, 32, 45, 74, 65, 45, 77, 89],
],
],
'labels' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
];
}

protected function getType(): string
{
return 'bar';
}
protected static ?int $sort = 2;

protected int|string|array $columnSpan = 8;

protected static ?string $heading = 'Son bir ayın istatistiği';

protected static ?string $maxHeight = '370px';


protected function getData(): array
{
return [
'datasets' => [
[
'label' => 'Kontrol edilen danışan sayısı',
'data' => [0, 10, 5, 2, 21, 32, 45, 74, 65, 45, 77, 89],
],
],
'labels' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
];
}

protected function getType(): string
{
return 'bar';
}
third stats in one widget goes down as writes DUMMY
protected static int|null $sort = 3;

protected int | string | array $columnSpan = 4;

public function getColumns(): int
{
return 1;
}

protected function getStats(): array
{
return [
Stat::make('DUMMY', '89')
->description('Bu ayki randevuların tamamlanma oranı')
->descriptionIcon('heroicon-m-arrow-trending-up'),

Stat::make('DUMMY', '21%')
->description('Bu ayki iptal edilen randevuların oranı')
->descriptionIcon('heroicon-m-arrow-trending-down'),

Stat::make('DUMMY', '3:12')
->description('Bu ayki toplam randevu')
->descriptionIcon('heroicon-m-arrow-trending-up'),
];
protected static int|null $sort = 3;

protected int | string | array $columnSpan = 4;

public function getColumns(): int
{
return 1;
}

protected function getStats(): array
{
return [
Stat::make('DUMMY', '89')
->description('Bu ayki randevuların tamamlanma oranı')
->descriptionIcon('heroicon-m-arrow-trending-up'),

Stat::make('DUMMY', '21%')
->description('Bu ayki iptal edilen randevuların oranı')
->descriptionIcon('heroicon-m-arrow-trending-down'),

Stat::make('DUMMY', '3:12')
->description('Bu ayki toplam randevu')
->descriptionIcon('heroicon-m-arrow-trending-up'),
];
Want results from more Discord servers?
Add your server