@php $points=$chart['points']; $maximum=max([1,...array_column($points,'value')]); $hasValues=array_sum(array_column($points,'value'))>0; $decimals=$chart['precision'] ?? (!empty($chart['money']) ? 2 : 0); @endphp

{{ $chart['title'] }}

{{ $chart['note'] ?? '' }}

@if(!$hasValues)
No activity to display

Try another period or facility. No sample data is shown.

@elseif($chart['type']==='heatmap')
@foreach($points as $point)
{{ $point['value'] }}{{ $point['label'] }}
@endforeach

Lighter → darker: fewer → more patients. Cells are residence categories, not geographic positions.

@elseif($chart['type']==='geoheat') @php $minX=min(array_column($points,'x'));$maxX=max(array_column($points,'x'))+1; $minY=min(array_column($points,'y'));$maxY=max(array_column($points,'y'))+1; $width=max(1,$maxX-$minX);$height=max(1,$maxY-$minY); @endphp @foreach($points as $point) {{ $point['label'] }}: {{ $point['value'] }} patients @endforeach {{ number_format($minX/10,1) }}° longitude{{ number_format($maxX/10,1) }}° longitude {{ number_format($maxY/10,1) }}° lat{{ number_format($minY/10,1) }}° lat

North ↑ · Darker cells indicate higher patient counts. Grid cells are not area-adjusted population rates.

@elseif($chart['type']==='pie') @php $total=array_sum(array_column($points,'value')); $colours=array_map(fn($point)=>\App\Services\Hms\ChartColors::category($point['label'],$chart['title']),$points); $stops=[];$offset=0; foreach($points as $i=>$point) { $end=$offset+100*$point['value']/$total; $stops[]=$colours[$i].' '.$offset.'% '.$end.'%'; $offset=$end; } @endphp
@elseif($chart['type']==='line') @for($tick=0;$tick<=4;$tick++) @php $y=180-$tick*40; @endphp {{ number_format($maximum*$tick/4,$decimals) }} @endfor @php $coordinates=[]; $count=count($points); foreach($points as $i=>$point) { $coordinates[]=(58+542*$i/max(1,$count-1)).','. (180-160*$point['value']/$maximum); } @endphp @foreach($points as $i=>$point) {{ $point['label'] }}: {{ number_format($point['value'],$decimals) }} @endforeach {{ $points[0]['label'] }} {{ $points[count($points)-1]['label'] }} @else
@foreach($points as $point)
{{ number_format($point['value'],$decimals) }}
{{ $point['label'] }}: {{ number_format($point['value'],$decimals) }}
{{ $point['label'] }}
@endforeach
@endif
View exact figures
@forelse($points as $point) @empty@endforelse
{{ $chart['title'] }}
Category / dateValue
{{ $point['label'] }}{{ number_format($point['value'],$decimals) }}
No records in this scope.