#NEWLINE# def make_piechart( id , data , unit = 'users' ) : #NEWLINE# #INDENT# xdata = [ i [ 0 ] for i in data ] #NEWLINE# ydata = [ i [ 1 ] for i in data ] #NEWLINE# extra_serie = { #NEWLINE# #INDENT# 'tooltip' : { #NEWLINE# #INDENT# 'y_start' : '' , #NEWLINE# 'y_end' : ( ' ' + unit ) , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# chartdata = { #NEWLINE# #INDENT# 'x' : xdata , #NEWLINE# 'y1' : ydata , #NEWLINE# 'extra1' : extra_serie , #NEWLINE# #UNINDENT# } #NEWLINE# charttype = 'pieChart' #NEWLINE# chartcontainer = ( 'chart_container_%s' % id ) #NEWLINE# data = { #NEWLINE# #INDENT# 'charttype' : charttype , #NEWLINE# 'chartdata' : chartdata , #NEWLINE# 'chartcontainer' : chartcontainer , #NEWLINE# 'extra' : { #NEWLINE# #INDENT# 'x_is_date' : False , #NEWLINE# 'x_axis_format' : '' , #NEWLINE# 'tag_script_js' : True , #NEWLINE# 'jquery_on_ready' : False , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# return data