a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

PHP total graph

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> PHP total graph
Page: [1]
 
womble

 

Posts: 5721
Joined: 3/14/2005
From: Living on the edge
Status: offline

 
PHP total graph - 5/13/2007 7:44:55   
Okay, never one to make life easy for myself, I need to develop some sort of fundraising tracking type graph for a site, kind of along the lines of TickerFactory, but not quite so tacky, and vertical rather than horizontal, and nice clean xhtml and accessible code as well, oh, and using specific images. Not too much to ask is it? :)

Having spent half the morning googling for such a thing, I've come to the conclusion that such a thing either doesn't exist, or I'm using the wrong search terms. As ever, I'm guessing that such a thing ain't gonna exist off the peg (unless anyone knows otherwise), soooooo, my next question is, any ideas how I'd go about doing such a thing?

I'm thinking PHP (*nix server), and hacking something from hotscripts.com to death. Having spent some time wandering around there I've found there's oodles of dynamic graph producing scripts, some which output as html/css, but as always getting the output xhtml valid and accessible is a problem. Anyone any ideas on where I should start with this?

This looks like the closest to what I'm trying to acheive that I've found at the moment, but I've not looked at it in any great depth, so I'm not sure if the image is changeable, and as it outputs an image, it's not accessible really unless I use a longdesc or something. Hmmmmm.....

*wanders off to find some food*

_____________________________

~~ "A cruel god ain't no god at all" ~~
~~ Erase hate. Practice love. ~~
:)
jaybee

 

Posts: 14207
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: PHP total graph - 5/13/2007 9:08:29   
How about using PHP to produce a css bar graph? Not looked into it in any great detail but take a look at some of these. You wouldn't need all the lines so it ought to be more straightforward.

Calculate the percentage of the total and just display a different image. Depending on the final size of the thing you wouldn't need too many images as peple won't be able to tell the difference between 37% and 38% for example.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to womble)
womble

 

Posts: 5721
Joined: 3/14/2005
From: Living on the edge
Status: offline

 
RE: PHP total graph - 5/13/2007 13:34:31   
Thanks Jaybee. I'll take a look at those - may come in useful for other stuff. In the meantime though this morning I posted over at Accessify as well about the accessibility angle of the one I was thinking of using, then went out this afternoon, and have come back in to find that some kind soul over there's pointed me in the direction of a recent article at Vitamin, which using the copy 'n' paste method of site development :) has given me a lovely xhtml strict/css and accessible solution that uses some rather cool unobtrusive javascript for an optional animation effect. JS off, you just get no animation. Images off, you get a progress bar type thing with the amount displayed, and both off and you just get the amount (%) displayed. It's not precisely what I'd imagined visually (colour-wise), but with everything else there I can live with the image with a little tweaking to the colours.

*is a happy Wombley* :) <---- Wombley looking happy

Ooops! Nearly forgot - the link's here! :)

_____________________________

~~ "A cruel god ain't no god at all" ~~
~~ Erase hate. Practice love. ~~
:)

(in reply to jaybee)
jaybee

 

Posts: 14207
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: PHP total graph - 5/13/2007 15:38:06   
That's exactly what I meant but seeing it, man that's nice. I'll bookmark that one.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to womble)
treetopsranch

 

Posts: 1209
From: Cottage Grove, OR, USA
Status: offline

 
RE: PHP total graph - 5/13/2007 16:06:08   
There are no amounts or totals shown on that thermometer graph. Wouldn't your viewers want to know what was being graphed? I thought that the whole idea of a graph was to present data at a glance without having to read tons of paragraphs to see what was being graphed.

_____________________________

Don from TreeTops Ranch, Oregon

"I've got a taste for quality and luxury"


(in reply to jaybee)
womble

 

Posts: 5721
Joined: 3/14/2005
From: Living on the edge
Status: offline

 
RE: PHP total graph - 5/13/2007 16:41:57   
Yep, 'tis nice isn't it Jaybee? <grin> Took all of about 5 minutes to set it up too, then probably another 5 to tweak the image. (I just changed the background colour of the thermometer because it's in a sidebar that's got a coloured background)

quote:

There are no amounts or totals shown on that thermometer graph.

Yes, ideally Don I would have liked an actual figure rather than a %, but I think that's probably the best I'm going to get that's xhtml strict and accessible and that easy to install. Mostly, as I've discovered the past couple of days looking for something to do this, anything that produces the "graph" using images is a huge PITA to make accessible. I've just realised though, the height of the "mercury" is controlled by the CSS, so in theory I could actually display the % or the £££ figure (the one that's between the <p> tags, as if you take out the display: none for the current-value class, that appears at the top of the "mercury". I'll see what the client prefers.

The way I've set it up at the moment though it's got a heading of "Our fundraising target this year" and the amount, and then underneath it "total to date" and the amount, with the thermometer thing underneath. Really it's just a quick graphical representation of the rough progress for those who aren't too hot with figures so they can just look at the graph and see yeah, they're about half way there or whatever. There'll be more in depth information further into the site, but the client just wanted something visual for the home page.

The only problem I've discovered is if they actually exceed the target - because the image is a fixed size and if the amount's more than 100% a red column shoots out of the top of it! :)

_____________________________

~~ "A cruel god ain't no god at all" ~~
~~ Erase hate. Practice love. ~~
:)

(in reply to treetopsranch)
jaybee

 

Posts: 14207
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: PHP total graph - 5/13/2007 16:55:29   
You need a sort of WHOOSH! graphic for when that happens. :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to womble)
womble

 

Posts: 5721
Joined: 3/14/2005
From: Living on the edge
Status: offline

 
RE: PHP total graph - 5/13/2007 17:44:36   
Either that or a "please don't donate any more cos it breaks our website" banner :)

_____________________________

~~ "A cruel god ain't no god at all" ~~
~~ Erase hate. Practice love. ~~
:)

(in reply to jaybee)
treetopsranch

 

Posts: 1209
From: Cottage Grove, OR, USA
Status: offline

 
RE: PHP total graph - 5/13/2007 21:23:33   
Hmm...on NS, FF and IE there are no percentages shown on that link example, just tick marks. Also the javascript part does not seem to work on NS or IE but does on FF but only for a split second as the page loads. (A super quick red flash occurs on FF)

If you do a page reload on FF then the javascript seems to work correctly. Must be a broadband problem. My new DSL modem is just too fast. :)

_____________________________

Don from TreeTops Ranch, Oregon

"I've got a taste for quality and luxury"


(in reply to womble)
jaybee

 

Posts: 14207
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: PHP total graph - 5/14/2007 4:04:58   
I set up a test one without the js and that was fine.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to treetopsranch)
BobbyDouglas

 

Posts: 5479
Joined: 5/15/2003
From: Arizona
Status: offline

 
RE: PHP total graph - 5/14/2007 14:21:47   
I did something similar to this using CSS for our rating system @ ja mbo nie.com

The width/position is hard coded into the html code, which will display the correct number of stars for the song. PHP simply outputs the correct width for each song, and then a style is applied to the image to display the correct rating.

_____________________________

Arizona Web Design - Mr Bobs Web Design in Arizona
The Arizona Web Hosting Challenge

(in reply to jaybee)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> General Web Development >> PHP total graph
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts