Archived

This topic is now archived and is closed to further replies.

Sander

Creating graphs with HTML/PHP

Recommended Posts

I''m working on a website and I have to include some graphs based on data I get out of MySQL. I''ve been thinking about different ways of doing this but I ran into trouble: - HTML: Lot''s of icky TABLE and possible IMG tags. It works but it will be truly horrible. Besides that, I think I''ll only be able to do bar graphs with this. - PHP: I have PHP 4.2.3 and it has a nice collection of image functions to fulfill any ones wildest fantasies. But it''s an extension (It''s called GD and uses among other things the LibPNG, zLib, and a few other graphics libs). After doing some checking around I find that it''s not installed. And I can''t install it eighter (it''s not my server). I have to make do without it. I do have one advantage: I know all my users will use IE 5. So, is there any way to create graphs? Is there vector graphics support I don''t know about yet (eg, like excel and word have)? Anything at all I can do to create graphs without GD support and without diving into pure HTML hell?? Sander Maréchal [Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]

Share this post


Link to post
Share on other sites
if you can''t touch the server, your only way out will be something like a plugin, like Flash, where you read the graph data from a text file or something.

In html it doesnt need to be a horror.
In bar graphics you only need a 1 pixel image (1x1), red for example, and then you can resize it to whatever size you require that bar to be.

In my opinion, just contact the Server Admin and ask him to install the GD extensions, its one of the easiests things to do, it simply involved the copy of ONE dll and the editing of php.ini (iirc), hardly anything out of this world, and if it takes more than 5 mins, then that Server Admin doesnt deserve his job...

Hope it helped...

[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD]
The grass is always greener on the other server.

Share this post


Link to post
Share on other sites
I guess your right. I''ve been looking into W3C''s SVG standard, but that one needs plugins as well. And since most computers at our network don''t have direct internet access this is going to be a problem too.

I had hoped that there was some functionality that I just overlooked or that came standard with IE5. Guess not. I''m going to bug the sysAdmin for GD now

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]

Share this post


Link to post
Share on other sites
When I've done graphing inside PHP I've used this library quite a bit. Nice and OO and plenty of examples. http://www.aditus.nu/jpgraph/index.php. You'll still need GD but having this library behind the scenes will make your life a lot easier . Also since once of your requirements is a pretty old PHP you'll find that some of the older versions of jpGraph in the download section will support your version of PHP (the newer one have been written for PHP 4.3.0 and larger)



[edited by - deepdene on November 17, 2003 9:38:24 AM]

Share this post


Link to post
Share on other sites
I saw that jpgraph lib before. It came with my xampp server that I use at home. Pretty good and powerfull but also a bit too loaded for my intensions, that''s why I wanted to try graphing things myself (That was before I discovered that my server at work doesn''t have GD).

Thanks anyway!


Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]

Share this post


Link to post
Share on other sites