Na serwerze localhost wykres wyświetla się ładnie, jednak na serwerze "w necie" nie działa.
Oto mój kod:
<?php function gen_wykres($dane, $width = 500, $height = 250, $dist = 10, $tlo = 'grad.jpg', $font = 'Dosis-ExtraBold.ttf') { $wykres = imagecreatetruecolor($width, $height); $bcg_image = imagecreatefromjpeg($tlo); $background = imagecolorat($bcg_image, 0, imagesy($bcg_image) - 1); imagefill($wykres, 0, 0, $background); imagecopyresampled($wykres, $bcg_image, 0, 0, 0, 0, $width, imagesy($bcg_image), imagesx($bcg_image), imagesy($bcg_image)); $mnoznik = ($height - ($dist * 2)) / $max; foreach ($dane as $key => $value) { $colors[$key] = imagecolorallocate($wykres, $col, 200, 0); $text_color[$key] = imagecolorallocate($wykres, 0, 0, 0); $top = $height - ($dist) - $value * $mnoznik; $left = $i * $el_width + $dist; imagefilledrectangle($wykres, $left, $top, $left + $el_width - $dist, $height - $dist, $colors[$key]); imagettftext($wykres, 10, 90, $left + $el_width / 2, $height - $dist - 2, $text_color[$key], $font, $key.' - '.$value.''); $i++; } return $wykres; } include('../include/db_connect.php'); $Query="SELECT * FROM odslony ORDER by id DESC LIMIT 10"; { $data = $row['odslony']; $dane[$row['id']] = $row['odslony']; } $wykres = gen_wykres($dane, 600, 180, 10); imagepng($wykres); ?>
jak widać jest niemal identyczny jak w artykule.
Czy mógłby mi ktoś wskazać jakieś błędy?