PDA

View Full Version : Quick PHP Question


Mayo
12-03-2002, 12:49 PM
Just wondering.
In PHP I know you can show data as a bar graph but I need to show the data as a Line Graph.
Is this possible.
I am waiting for an answer off my coder but he is slow in getting back to me. Well he is in France.
Oh and its work related btw lol. We are automating our European Traffic Report and having it web based. lol.
Just hoping we can have line graphs :)

ShoX
12-03-2002, 01:09 PM
Yes its possible.
Yes its difficult.

And Yes, you need to have the GD Graphics library installed to do it.

Co-ordinates suck :/

Rob

Mayo
12-03-2002, 01:16 PM
Sok thats what this guy in France gets payed mega bucks to do lol.

Put it this way he is a contractor.
Living in the posh part of Paris
He can blody well get it sorted lol

Boff
12-03-2002, 06:44 PM
first guess. and this is a crap solution but this IS my basic mentality.

get a solid picture gif.

say a solid blue. ten pixels by ten pixels.

<img src="bar.gif" height="10" width="100%">
now bizarely enough if you have a table this gif will stretch the whole width of it.

Now aside from Netscape3 for the pc and 4 and 4.7 for the mac,
this will work.
(dunno about IE3 for the PC)

so just asign that width a variable in your PHP instead of a full 100% and bobs your uncle you ahve a bar chart thingy.

Bobster
12-03-2002, 06:47 PM
theres no way i'm related to Shox thanx :)

MaZ
12-03-2002, 07:11 PM
As Rob said. You CAN do it, its very hard, but there ARE functions in PHP to do it. Unfortunately, as Rob said as well, you gotta have the GD Graphics Library compiled in PHP and unless u do that yourself, not a huge amount of places have it. :(
I tried to use it on a recent project, the commands in php i mean.. Rlly screws you up when u realise u need something extra that u cant install.
/me cries...

WHY O WHY CANT THEY INCLUDE THE GD LIBRARY IN PHP?!?! :u05

ShoX
13-03-2002, 09:08 AM
Cos it sucks CPU like no tommorow mostly :/

Rob

ShoX
13-03-2002, 09:11 AM
That and its not really PHP, its an outside project, and due to the fact that PHP is uber optimised, they wont include it till they have the time/inclination to refine it.

And PHP5 is being developed as a OO Style language on par with Java, so they have quite a bit to do i would imagine.

Rob

MaZ
13-03-2002, 07:01 PM
thats true you sexeh beast you :D

Boff
14-03-2002, 01:07 PM
Okay new one,

I just got offered a "is it possible to do this job, and how would you go about it",
just ideas that's all I need.

conusultants can sign up, with their name, job description, location of place they are visiting.

and here is the killer.

It displays the "nearest" other consultant.
Simple solution
1) Now just doing a match on
town,
city or country,
and list anyone else in the local region. (ie different fields in a database and doing a simple match)

but gut feeling says they will want maps and allsorts to go along with this (cough link to multimap)

or even if they want a 'distance' between places.

ideas? if this is the case.

ShoX
14-03-2002, 01:33 PM
Use postcodes, and you can get a near enough match by going off the intial chars.

Not sure about calculating the distance, you could pump it into something like the AA roadmap thing, and strip the page down that gives you the result.

But thats naughty, and you didnt hear it from me :]

Rob