A related mechanism to show horizontal bar graph is to simply use a table where you caculate the percentage width ... Following is some JSTL that demonstrates.

<table width='<fmt:formatNumber pattern="##"
value="${(item.totalVotes / item.maxPossibleVotes) * 100}"/>%'
bgcolor="#003366">
<tr>
<td align="right">
<font color="white">
<c:out value="${item.totalVotes}"/>/<c:out value="${item.maxPossibleVotes}"/>
</font>
</td>
</tr>
</table>


Adam Hardy wrote:

On 04/01/2004 09:09 PM Erez Efrati wrote:

Hi all, It is a bit off topic but still I thought maybe someone in the Struts
air space would have a clue of something I don't :)
I am looking for a way or package to present poll results in my web
application. Any ideas of such library / tag / javascript ? Thanks in advance,
- Erez




Assuming that it is a simple results display with % per option, just create a png of your chosen colour and then calculate the necessary width for it for each option based on the % result.

That's a roll-your-own solution :)

I never saw any open-source solutions though I'm afraid. If you want to pay, then check in the webdesign-l archives at http://www.webdesign-l.com/ for a thread I remember reading in the last six months or so.

Adam



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to