bar charts

11 views
Skip to first unread message

Jochen Maes

unread,
Dec 5, 2008, 6:39:25 AM12/5/08
to Python Google Chart
Hey all,


I'm trying to show 20 baqrs horizontally, and each bar should have a
label, this is the python code:
def create_chart(data, file):
chart = GroupedHorizontalBarChart(300, 300, x_range=(0, 1000000))
chart.set_bar_width(10)
labels = list()
for dat in data[-20:]:
labels.append(dat[0].strip())
chart.add_data([dat[1],])
chart.set_axis_labels(Axis.LEFT, labels)
chart.download('test.png')

here is the result, why do i only see one label?
http://chart.apis.google.com/chart?cht=bhg&chs=300x300&chd=e:AL,AL,AO,AP,AP,AR,AU,AZ,Ah,Am,Az,BD,BN,BT,B4,CN,Ci,Ct,Fg,Fn&chxt=y&chxl=0:|WeeChat|Gaim%20IRC|KVIrc|LimeChat|Kopete|Opera|CGI%3AIRC|Trillian|X-Chat%20Aqua|Miranda|PJIRC|http%3A//www.mibbit.com|ChatZilla|Konversation|Irssi|libirc|Colloquy|mIRC|X-Chat|Pidgin/Finch/Adium&chbh=10

thanks

Jochen
Reply all
Reply to author
Forward
0 new messages