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
https://forums.phpfreaks.com/topic/67573-percentage-graph/
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
https://forums.phpfreaks.com/topic/67573-percentage-graph/#findComment-339474
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
https://forums.phpfreaks.com/topic/67573-percentage-graph/#findComment-340461
Share on other sites

Archived

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

×
×
  • 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.