Does anyone know how to add a tooltip for the header section of a chat widget ?

i need the tooltip icon on right end of header. and by hovering it should show tool-tip.

i had try using html string for $heading but it only accept string so, can use that method.

<?php

namespace App\Filament\Widgets;

use App\Services\Cache\CacheService;
use BezhanSalleh\FilamentShield\Traits\HasWidgetShield;
use Filament\Widgets\LineChartWidget;

class LetTimeChart extends LineChartWidget
{
use HasWidgetShield;

protected static ?string $heading = 'Average time to let';

protected int | string | array $columnSpan = '45%';

protected static ?string $pollingInterval = null;

protected static ?int $sort = 1;

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

protected static ?array $options = [
'plugins' => [
'htmlLegend' => [
'containerID' => 'legend-container',
],
'legend' => [
'display' => false,
'align' => 'end',
],
],
];

protected function getFilters(): ?array
{
return [];
}

protected function getData(): array
{
$averageLetTime = CacheService::getModelData('getAverageLetTime');
return [
'datasets' => [
[
'label' => 'Days',
'data' => $averageLetTime?->pluck('value')->toArray(),
'tension' => 0.2,
'borderColor' => 'rgb(127, 113, 239)',
'backgroundColor' => 'rgb(127, 113, 239)',
],
],
'labels' => $averageLetTime?->pluck('month')->toArray(),
];
}

}
image_2024_05_24T13_02_28_941Z.png
Was this page helpful?