$value) { $barHeight = ($value / $maxValue) * ($imageHeight - $barSpacing); $x1 = ($key * $barWidth) + $barSpacing; $y1 = $imageHeight - $barHeight; $x2 = (($key + 1) * $barWidth) - $barSpacing; $y2 = $imageHeight; imagefilledrectangle($image, $x1, $y1, $x2, $y2, $barColor); } // Ustawienie nagłówka dla obrazka header('Content-Type: image/png'); // Wyświetlenie obrazka imagepng($image); // Zwolnienie zasobów imagedestroy($image); ?>