@if($returnRatioChartImage || $chartImage)
{{ __('Reciprocity Rate Timeline') }} ({{ min($chartData['values']) }}% - {{ max($chartData['values']) }}%)
{{ number_format($chartData['maxValue'], 0) }}%
{{ number_format(($chartData['maxValue'] + $chartData['minValue']) / 2, 0) }}%
{{ number_format($chartData['minValue'], 0) }}%
@for ($i = 1; $i <= 4; $i++)
@endfor
@if(count($chartData['points']) > 1)
@for ($i = 0; $i < count($chartData['points']) - 1; $i++)
@php
list($x1, $y1) = explode(',', $chartData['points'][$i]);
list($x2, $y2) = explode(',', $chartData['points'][$i + 1]);
// Convert to chart coordinates (scale to 80% and offset by 10%)
$x1_pos = $x1 * 0.8 + 10;
$y1_pos = $y1 * 0.8 + 10;
$x2_pos = $x2 * 0.8 + 10;
$y2_pos = $y2 * 0.8 + 10;
// Calculate line properties for straight line
$width = abs($x2_pos - $x1_pos);
$height = abs($y2_pos - $y1_pos);
$left = min($x1_pos, $x2_pos);
$top = min($y1_pos, $y2_pos);
// Determine if line is more horizontal or vertical
$isHorizontal = $width > $height;
@endphp
@if($isHorizontal)
@else
@endif
@endfor
@endif
@if(count($chartData['trendPoints']) > 1)
@for ($i = 0; $i < count($chartData['trendPoints']) - 1; $i++)
@php
list($x1, $y1) = explode(',', $chartData['trendPoints'][$i]);
list($x2, $y2) = explode(',', $chartData['trendPoints'][$i + 1]);
$x1_pos = $x1 * 0.8 + 10;
$y1_pos = $y1 * 0.8 + 10;
$x2_pos = $x2 * 0.8 + 10;
$y2_pos = $y2 * 0.8 + 10;
$width = abs($x2_pos - $x1_pos);
$height = abs($y2_pos - $y1_pos);
$left = min($x1_pos, $x2_pos);
$top = min($y1_pos, $y2_pos);
$isHorizontal = $width > $height;
@endphp
@if($isHorizontal)
@else
@endif
@endfor
@endif
@if(count($chartData['points']) > 0)
@foreach ($chartData['points'] as $index => $point)
@php
list($x, $y) = explode(',', $point);
@endphp
@endforeach
@endif
Reciprocity Rate Over Time
@foreach ($returnRatioTimelineData as $index => $point)
@if ($index == 0 || $index == count($returnRatioTimelineData) - 1 || $index % max(1, floor(count($returnRatioTimelineData) / 6)) == 0)
{{ $point['label'] }}
@endif
@endforeach