Results 1 to 14 of 14
  1. #1

    Analog "Gauge Style" progress meters

    I'm looking for some guidance on a code snippet (php, javascript, DHTML, don't care) which impliments an analog gauge (tachometer, speedometer, whatever).

    Does anyone know of anything out there?

    Thanks!

  2. #2
    Join Date
    Nov 2001
    Posts
    857
    You can't use flash?
    <?
    header("Location: http://www.hostevolve.com/");
    ?>

  3. #3
    Well, this is a hot-ticket tossed-together site. I am on an extremely tight deadline, and this is my first real foray into PHP. Additionally, I haven't touched web stuff since about 1996.

    The other option was using a gauge package written in VC++ but I determined that the integration needed would have taken too long in a compiled language. (Especially considering that it would have been db->php->vc++ application. This way, it's at least DB->php only)

    Quicker, no ui quirks to worry about, etc...


    So, to answer your question, I guess that flash would be an option, but the data is relatively static (updated hourly) and I have no experience w/ flash.

    If there is flash stuff out there I can use as a module or the like, then it would be acceptable, but I don't have the capabilities to work w/ flash (no software).

    --dw

  4. #4
    Join Date
    Nov 2001
    Posts
    857
    Well if the gauge will only be updated once an hour flash would probably be overkill anyway.

    I thought it was something you wanted that would progress rather quickly. My bad.

    Have you looked at hotscripts.com. You might find something there. Coding it in php should be simple enough if you already have the images made up for each stage of the meter. Really all you would need the php to do is see what stage you are at and call the correct picture. Well that would be an over simplified way to do it. There are other ways but you get my point.

    Keep in mind anything server side will be static though. I.E. (PHP, PERL, c++) will only show a static picture. To update it you would have to refresh the webpage.
    <?
    header("Location: http://www.hostevolve.com/");
    ?>

  5. #5
    Join Date
    Aug 2002
    Location
    Superior, CO, USA
    Posts
    633
    I'm a little confused as to what you're looking for. You say the data only updates hourly. Are you just looking to dynamically generate an image at the time that a page on the server is queried? Or are you looking for something on the client side that polls the server and updates? Flash or a Java applet would work fine on the client side. They would poll the server and get back, say, a number between 1 and 100 and display that much.

    But if your data doesn't change much that seems like overkill. I'd just generate some HTML element at the time the page is run (I'm assuming something like JSP/PHP/ASP on the server side). For example, you could create a table, set a background on the <tr> element and make a <td> element some number of pixels wide based on the width you want. It would create a solid bar that could change everytime the page is loaded. It would likely be wrapped in a pretty output.

    Otherwise I agree with michaeln - just have the server side send the right image. As mentioned, set the no-cache header in the HTML so that any reloads are more likely to get through.

  6. #6
    Join Date
    Nov 2001
    Posts
    857
    I am not sure if you will be able to alter these to fit your needs. I found them on hotscripts.

    Hopefully someone will come along and post exactly what you need.

    http://www.javascriptkit.com/script/...gressbar.shtml
    http://www.dynamicdrive.com/dynamici...mlprogress.htm
    <?
    header("Location: http://www.hostevolve.com/");
    ?>

  7. #7
    Join Date
    Mar 2004
    Location
    Granville OH
    Posts
    108
    PHPEclipse claims to have a plugin that can do this. You might be able to strip it out and use it... if you can find it. I tried to search their site, but it wasn't rendering properly in my browser.

  8. #8
    Thanks for the "Progress Bar" links. I'm currently using them, but my boss wanted something more "flashy". His original "idea" was a "dashboard" which had automotive/airplane gauges that would display progress.

    From a coding perspective, progress bars, are much easier, but he wants what he wants *sigh*.

    I want the progress to be modified whenever the page is loaded. Sorry for the confusion. The main site is a php script with post methods to change to separate views of data.

    So, looks like I'm still at the point of modifying/constructing the images myself.

  9. #9
    Join Date
    Nov 2001
    Posts
    857
    Well it shouldn't take that long to create the images in something like Fireworks. I don't know what you are trying to do but if it is a slow progression over a period of a few hours I would think you should only need 10 or 11 images per gauge. One for 0%, 10%, 20%, 30%, 40%, 50% and so on. Then the php to display the correct image would be extremely easy.

    Michael
    <?
    header("Location: http://www.hostevolve.com/");
    ?>

  10. #10
    Join Date
    Mar 2004
    Posts
    407
    His original "idea" was a "dashboard" which had automotive/airplane gauges that would display progress.
    I am going to go barf right now.

    =O##
    Alvin

  11. #11
    Join Date
    Feb 2004
    Posts
    44
    I've done this with a table... First column is <td width=xx%>, second column has width=100-xx%. You can give the cell an image background if you want it to look fancy. Very easy.

  12. #12
    Join Date
    Mar 2004
    Posts
    407
    i do the same thing as cleaver when i need a graph bar or guage.

    however, rotinom wants a gauge like one found in a plane or car and then have it look like it is in a dashboard.
    Alvin

  13. #13
    Join Date
    Mar 2004
    Location
    Granville OH
    Posts
    108
    Actually shouldn't be too hard to code... All you're doing is taking a static background and drawing a line on top of it. Use a little bit of trig and presto... of course... I'm too busy to do it for you right now...

  14. #14
    Heh. I sort of figured that was the way that I'd have to go. Oh the joys of drinking from a firehose. *Looks up PHP graphics functions*

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •