($height-$dist)) $top=($height-$dist); $i=0; foreach ($dane as $key => $value) { $va=round($value*$mky)+$ConstY; $col = 255-round($va/0.6); //round(255 - (150 / count($dane)) * $i); $colors[$key] = imagecolorallocate($wykres, $col, 200, 0); $text_color[$key] = imagecolorallocate($wykres, 0,0,0); $left = $i * $el_width + $dist; $srodek=$left + round($el_width/2)+5; imagefilledrectangle($wykres, $left, $va, $left + $el_width - $dist, $top, $colors[$key]); imagettftext($wykres, 16, 90, $srodek, $height - $dist - 20, $text_color[$key], $font, $key.': '.round($value,1).''); $i++; } imagettftext($wykres, 8, 0, 2,10, $text_color[$key], $font,'©2025Tad1ak'); return $wykres; } $filename = "DaneDawkiUV.txt"; $output = Array(); foreach(file($filename) as $w){ $w = explode('|', $w); // lub rtrim($w) w zależności czy dopuszczasz \n na końcu $output[ $w[0] ] = $w[1]; } $wykres = gen_wykres($output); imagepng($wykres); ?>