- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
<?php
Class Draw
{
// вырисовка графика баланса
function Graph($y1,$y2,$y3,$y4,$y5,$y6,$y7,$firstday) {
header ("Content-type: image/png");
$im = imagecreatefrompng("graph.png");
$text_color = imagecolorallocate($im, 233, 14, 91);
$color = imagecolorallocate($im, 0, 0, 0);
$bg = imagecolorallocate($im, 180, 180, 200);
#--------------------------------------------------------
imagefill ($im, 0, 0, $bg);
#---------------------------------------------------------
imageline($im, 50, 0, 1000, 0, $color);
// в это же духе еще ~10 строк
imageline($im, 50, 900, 1000, 900, $color);
#---------------------------------------------------------
imageline($im, 100, 950, 100, 0, $color);
// аналогично
imageline($im, 700, 950, 700, 0, $color);
#---------------------------------------------------------
imageline($im, 100, 1000-$y1, 200, 1000-$y2, $text_color);
imagefilledellipse ($im, 100, 1000-$y1, 10, 10, $color);
imagestring($im, 3, 115, 1000-$y1, $y1 . " RUB", $text_color);
imagestring($im, 5, 90, 960, $firstday, $text_color);
#-----------------------------------------------------------
imageline($im, 200, 1000-$y2, 300, 1000-$y3, $text_color);
imagefilledellipse ($im, 200, 1000-$y2, 10, 10, $color);
imagestring($im, 3, 215, 1000-$y2, $y2 . " RUB", $text_color);
imagestring($im, 5, 190, 960, $firstday+1, $text_color);
#-------------------------------------------------------------
imageline($im, 300, 1000-$y3, 400, 1000-$y4, $text_color);
imagefilledellipse ($im, 300, 1000-$y3, 10, 10, $color);
imagestring($im, 3, 315, 1000-$y3, $y3 . " RUB", $text_color);
imagestring($im, 5, 290, 960, $firstday+2, $text_color);
#------------------------------------------------------------
imageline($im, 400, 1000-$y4, 500, 1000-$y5, $text_color);
imagefilledellipse ($im, 400, 1000-$y4, 10, 10, $color);
imagestring($im, 3, 415, 1000-$y4, $y4 . " RUB", $text_color);
imagestring($im, 5, 390, 960, $firstday+3, $text_color);
#-----------------------------------------------------------
imageline($im, 500, 1000-$y5, 600, 1000-$y6, $text_color);
imagefilledellipse ($im, 500, 1000-$y5, 10, 10, $color);
imagestring($im, 3, 515, 1000-$y5, $y5 . " RUB", $text_color);
imagestring($im, 5, 490, 960, $firstday+4, $text_color);
#------------------------------------------------------------
imageline($im, 600, 1000-$y6, 700, 1000-$y7, $text_color);
imagefilledellipse ($im, 600, 1000-$y6, 10, 10, $color);
imagestring($im, 3, 615, 1000-$y6, $y6 . " RUB", $text_color);
imagestring($im, 5, 590, 960, $firstday+5, $text_color);
#------------------------------------------------------------
imagefilledellipse ($im, 700, 1000-$y7, 10, 10, $color);
imagestring($im, 3, 715, 1000-$y7, $y7 . " RUB", $text_color);
imagestring($im, 5, 690, 960, $firstday+6, $text_color);
#---------------------------------------------------------
imagestring($im, 5, 0, 900, 100, $text_color);
imagestring($im, 5, 0, 800, 200, $text_color);
imagestring($im, 5, 0, 700, 300, $text_color);
imagestring($im, 5, 0, 600, 400, $text_color);
imagestring($im, 5, 0, 500, 500, $text_color);
imagestring($im, 5, 0, 400, 600, $text_color);
imagestring($im, 5, 0, 300, 700, $text_color);
imagestring($im, 5, 0, 200, 800, $text_color);
imagestring($im, 5, 0, 100, 900, $text_color);
imagestring($im, 5, 0, 0, 1000, $text_color);
#---------------------------------------------------------
imagepng($im);
imagedestroy($im);
}
}
?>