|
|||||||||||||||||||||
|
This method uses table cells filled with a clear image. The color of each bar is determined by the background color of the cell, not by the color of an image. The cell contains the clear image, the image width is stretched to the width specified on the img tag, which causes the table cell to expand to fit the image.
There's a little more setup involved than in the first method, for example in order for each bar to have a unique length each row in the chart must be it's own table, but it's worth the effort.
|
||||||||||||||||||||||||||||||||||||||||||||||
|
A single bar
A 50 50% |
<td height="6px" bgcolor="red" width="100"><font size="1px"> </font></td>
Set the width equal to the desired percentage. 100 for 100% 30 for 30%, etc. Choose a color.
A single bar, reduced height
B 33.05 9.28% |
|
A stacked bar
C 33.05 9.28% |
|
Here's how:
<!-- Bar Chart Element -->
<table>
<tbody cellpadding="0" cellspacing="0">
<tr>
<!-- Labels -->
<td><tt> C 33.05 9.28% </tt></td>
<!-- spacing -->
<td></td>
<!-- Stacked Bar -->
<table cellpadding="0" cellspacing="0">
<tr>
<!-- Bar 1 -->
<td height="6px" bgcolor="green" width="30"><font size="1px"> </font></td>
<!-- Bar 2 -->
<td height="6px" bgcolor="blue" width="70"><font size="1px"> </font></td>
</tr>
</table>
</tr>
</tbody>
</table>