I'm using the awesome Google Chart Wrapper to create charts as part of my Django project. Right now I'm creating the chart instance using Python in my views, and then adding the instance to the template context and displaying the charts in my templates successfully.
What I'm having trouble doing is displaying a dynamic set of X-Axis labels. Here is the relevant code from Google Chart Wrapper:
def label(self, index, *args):
"""
Label each axes one at a time
args are of the form <label 1>,...,<label n>
APIPARAM: chxl
"""
self.data['labels'].append(
str('%s:|%s'%(index, '|'.join(map(str,args)) )).replace('None','')
)
return self.parent
and how I'm currently creating the chart in my view:
from GChartWrapper import *
chart = Sparkline([1,2,3,4,5,6,7], encoding='text')
chart.axes.label(...) # need to set labels here
I have a list of date strings that I'd like to display as the x-axis labels, does anyone know how I would go about doing that?