(data='1,2,3',names='a,b,c',width=300,height=150,align='center')
return XML('<img src="http://chart.apis.google.com/chart?cht=p3&chd=s:cEj9U&chs=%(width)sx%(height)s&chl=%(names)s&chd=t:%(data)s" align="%(align)s">' % dict(data=data,width=width,height=height,names=names,align=align))
## Uses Google charting API to embed a pie chart
        - ``data`` is a list of comma separated values 
        - ``names`` is a list of comma separated labels (one for data item)
        - ``width`` is the width of the image
        - ``height`` is the height of the image
        - ``align`` determines the alignment of the image
## Uses Google charting API to embed a pie chart
        - ``data`` is a list of comma separated values 
        - ``names`` is a list of comma separated labels (one for data item)
        - ``width`` is the width of the image
        - ``height`` is the height of the image
        - ``align`` determines the alignment of the image
## Uses Google charting API to embed a pie chart - data is a list of comma separated values - names is a list of comma separated labels ( one for data item ) - width is the width of the image - height is the height of the image - align determines the alignment of the image
def pie_chart(data='1,2,3',names='a,b,c',width=300,height=150,align='center'):
        """
        ## Uses Google charting API to embed a pie chart
        - ``data`` is a list of comma separated values 
        - ``names`` is a list of comma separated labels (one for data item)
        - ``width`` is the width of the image
        - ``height`` is the height of the image
        - ``align`` determines the alignment of the image
        """
        if isinstance(data,str):
            data = data.replace(' ','')
        elif isinstance(data,dict):
            data = '|'.join(','.join(str(y) for y in s) for s in data.values())
        elif isinstance(data,list):
            data = ','.join(str(y) for y in data)
        if isinstance(names,str):
            names = '|'.join(name.strip() for name in names.split(','))
        else:
            names = '|'.join(name for name in names)
        return XML('<img src="http://chart.apis.google.com/chart?cht=p3&chd=s:cEj9U&chs=%(width)sx%(height)s&chl=%(names)s&chd=t:%(data)s" align="%(align)s">' % dict(data=data,width=width,height=height,names=names,align=align))
def pie_chart ( data = '1,2,3' , names = 'a,b,c' , width = 300 , height = 150 , align = 'center' ) : if isinstance ( data , str ) : data = data . replace ( ' ' , '' ) elif isinstance ( data , dict ) : data = '|' . join ( ',' . join ( str ( y ) for y in s ) for s in data . values ( ) ) elif isinstance ( data , list ) : data = ',' . join ( str ( y ) for y in data ) if isinstance ( names , str ) : names = '|' . join ( name . strip ( ) for name in names . split ( ',' ) ) else : names = '|' . join ( name for name in names ) return XML ( '<img src="http://chart.apis.google.com/chart?cht=p3&chd=s:cEj9U&chs=%(width)sx%(height)s&chl=%(names)s&chd=t:%(data)s" align="%(align)s">' % dict ( data = data , width = width , height = height , names = names , align = align ) )