Re: if statement and imageline()
| From: | Richard Lynch | Date: | Wed, 22 Aug 2001 00:16:00 +0000 |
| Subject: | Re: if statement and imageline() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63833@lists.php.net to get a copy of this message | ||
What are you getting? An image at all? Broken image?
Try getting rid of the header("image/jpeg") or whatever, and see if you have
some error message.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Hugh Danaher <hdanaher@earthlink.net>
Newsgroups: php.general
To: Php-General <php-general@lists.php.net>
Sent: Tuesday, August 21, 2001 1:16 AM
Subject: if statement and imageline()
help,
I am trying to set up a .jpg file to graph the earnings per year of a
company. I can generate a log-normal graph, can get it to display the
earnings per year as circles on the graph, but I can't get the " if () "
statement to work. I know I am setting two of the variables in the if
statement after the if statement executes once, but these variables won't be
used until after the " for () " loops once, and therefore should be
available for use in " imageline() " on the second loop (where
$year>$startyear). Somehow, I think my logic is correct but it mustn't be
so.
$startyear=1996;
$chart_start_year=1992;
for ($year=$startyear;$year<=$startyear+7;$year++)
{
$x=(($year-$chart_start_year)*20)+20;
$y=420-log(${"earnings_".$year})*75;
if ($year>$startyear)
{
imageline($image,$first_x,$first_y,$x,$y,$blue);
}
$first_x=$x;
$first_y=$y;
imagettftext($image,9,0,$x_distance-4,$y_distance+3,$blue,$font2,"m");
}