Welcome Guest, Not a member yet? Register   Sign In
best practices to do that
#1

[eluser]7amza[/eluser]
hey
i have an idea but i don't know how to do it .
the idea that you put two numbers ex:
1
50
The program will generate a bar shows you the remaining period from the date of the beginning to the end date with a variable number .
so i attached a picture to illustrate the request .
#2

[eluser]smilie[/eluser]
I can think of 2 ways:

1. using 'static' images; you create image that represents 1% (which will be very small of course). Then, based on the progress (let's say 15%) you will simply echo that image within the bar 15 times.

2. Second option is to use one of PHP drawing libraries which can draw graphics (like GD for example, tho' I think there are better ones as well). This way, you set some parameters within the graph class, provide images / colors / ranges etc and PHP draws that object for you.

Regards,
Smilie
#3

[eluser]7amza[/eluser]
smilie the output must be a picture that people can you in there signature .
i like the second option so can you give me a small example to make me inside the code?
#4

[eluser]smilie[/eluser]
Hi,

Well, take a look at PHP GD library (it must also be supported by your server):
http://php.net/manual/en/book.image.php

Here are also some working examples (just download them and look through code):
http://www.phpf1.com/product/php-chart-script.html

Good luck :-)
Smilie




Theme © iAndrew 2016 - Forum software by © MyBB