| нарисовал график с помощью php, вставил подписи, на локалхост все работает, выложил в интернет, подписей нет:(
<?
function draw_graph($pts,$com)
{
$command = explode(";",$com);
$s = 15;
$s2 = 25;
$h = 16*$s;
$w = 30*$s2;
$image = imagecreate($w+100, $h+100);
imageantialias($image, true);
$color_body = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$color_line = imagecolorallocate($image, 0x00, 0x00, 0x00);
$color_grid = imagecolorallocate($image, 0xCC, 0xCC, 0xCC);
$color_grid_small = imagecolorallocate($image, 0xEE, 0xEE, 0xEE);
$color_text = imagecolorallocate($image, 0xFF, 0x44, 0x44);
imagefilledrectangle($image, 0, 0, $w+100, $h+100, $color_body);
$graph_font = 'tahoma.ttf';
$font_sizep = 8;
$x0 = 50;
$y0 = 30;
for ($i = 0; $i < 30; $i++){
$x = $i * $s2 + $x0;
imageline($image, $x, $y0, $x, $h+$y0-$s, $color_grid);
$k = imagettfbbox($font_sizep, 0, $graph_font, $i+1);
imagettftext($image, $font_sizep, 0, $x-($k[0]+$k[2])/2, $h+$y0, $color_line, $graph_font, $i+1);
}
for ($i = 0; $i < 16; $i++){
$y = $i * $s + $y0;
imageline($image, $x0, $y, $w+$x0-$s2, $y, $color_grid);
$k = imagettfbbox($font_sizep, 0, $graph_font, $i+1);
imagettftext($image, $font_sizep, 0, $x0-15-($k[0]+$k[2])/2, $y-($k[7]-$k[1])/2, $color_line, $graph_font, $i+1);
}
$font_size = 8;
...
$font = imagettfbbox($font_size, 0, $graph_font, 'Дни');
imagettftext($image, $font_size, 0, $x0, 20, $color_line, $graph_font, win2uni("Показатель"));
imagettftext($image, $font_size, 0, $w/2, $y0+$h-($font[7]-$font[1])+5, $color_line, $graph_font, win2uni("Дни"));
...
}
}
header("Content-type: image/gif");
imagegif($image);
imagedestroy($image);
}
|
| |