On Wed, 2008-09-24 at 06:20 -0700, [EMAIL PROTECTED] wrote:
> I have an app that tracks football stats, I'd like to use bar graphs
> similar to what's on Everyblock. This is their code:
> 
> http://dpaste.com/80211/
> 
> I was curious, how, if possible at all, in the template I could get
> the percentage for the height.
> 
> So, for my first graph, so far I'd have these numbers:
> 
> 390
> 314
> 402
> 429
> 
> The 429 should be 100%, and then down from there 402 (94%), 390 (91%),
> 314 (73%), etc, etc.

Have a look at the "widthratio" template tag that comes with Django
(refer to the documentation for details). Despite the name, there's
nothing particularly width-only about it. It just generates a value,
which could just as easily put into a height style attribute.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to