TurboFlot - A TurboGears widget for Flot, a jQuery plotting library. Requirements: - TurboGears - simplejson Example Usage: (comparable to http://people.iola.dk/olau/flot/examples/graph-types.html) === controllers.py ============================================================= @expose("myproject.templates.flot") def flot(self): import math from turboflot import TurboFlot d1 = [] i = 0 for x in range(26): d1.append((i, math.sin(i))) i += 0.5 d2 = [[0, 3], [4, 8], [8, 5], [9, 13]] d3 = [] i = 0 for x in range(26): d3.append((i, math.cos(i))) i += 0.5 d4 = [] i = 0 for x in range(26): d4.append((i, math.sqrt(i * 10))) i += 0.5 d5 = [] i = 0 for x in range(26): d5.append((i, math.sqrt(i))) i += 0.5 flot = TurboFlot([ { 'data' : d1, 'lines' : { 'show' : 'true', 'fill' : 'true' } }, { 'data' : d2, 'bars' : { 'show' : 'true' } }, { 'data' : d3, 'points' : { 'show' : 'true' } }, { 'data' : d4, 'lines' : { 'show' : 'true' } }, { 'data' : d5, 'lines' : { 'show' : 'true' }, 'points' : { 'show' : 'true' } } ]) return dict(flot=flot) === template.kid =============================================================== ${flot.display()}