Changes between Version 8 and Version 9 of BluePrint/Reporting


Ignore:
Timestamp:
01/12/09 12:50:11 (13 years ago)
Author:
Fran Boon
Comment:

T2 barchart()

Legend:

Unmodified
Added
Removed
Modified
  • BluePrint/Reporting

    v8 v9  
    55S2 version:
    66 * http://wiki.sahana.lk/doku.php?id=dev:reportinglib
     7
     8T2 includes a basic barchart function:
     9{{{
     10def barchart(data,width=400,height=15,scale=None,
     11             label_width=50,values_width=50):
     12    if not scale: scale=max([m for n,c,m in data])
     13    if not scale: return None
     14    return TABLE(_class='barchart',
     15           *[TR(TD(n,_width=label_width,_style="text-align: right"),
     16           TABLE(TR(TD(_width=int(m*width/scale),_height=height,
     17           _style='background-color:'+c))),TD(m,_width=values_width),
     18           _style="vertical-alignment: middle") for n,c,m in data])
     19}}}
    720
    821Could be something to use Flash?