Jump to content

Percentage Graph?


d22552000

Recommended Posts

What is the easiest way to show a table with two fields, the first ebing the percentage of progress adnt eh second being there to show blank.

 

I thought I could do:

 

 

<table bgcolor="black" width="50%" id="prg">

<tr>

<td bgcolor="green" width="prgprct"></td>

<td>&</td>

</tr>

 

 

I know that bgcolor isnt the right command and my ID is wrong but you get the point.  I have AJAX feeding the script the value but is there an easier way of showing the graph?

Link to comment
Share on other sites

Personally, I'd use a GD image but

 

<?php
$a = 100;
$b=40;
$c = 80;
echo <<<HTML
<table width='50%' bgcolor='black'>
<tr>
     <td bgcolor='red' width='$a%'>$a</td>
     <td></td>
</tr>
</table>
<table width='50%' bgcolor='black'>
<tr>
     <td bgcolor='yellow' width='$b%'>$b</td>
     <td></td>
</tr>
</table>
<table width='50%' bgcolor='black'>
<tr>
     <td bgcolor='orange' width='$c%'>$c</td>
     <td></td>
</tr>
</table>
HTML;
?>

 

Math content minimal, this is HTML, so moving it.

Link to comment
Share on other sites

wouldnt a gd image be problematic or slow loading if it was refreshing second wise?  also my apache doenst seem to like gd2 module.  when I enable it vbulletin still cant output gd2 images, so I had to use imagmagic and I dont even know how to work it -,-.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.