snake007uk
unread,Jul 8, 2009, 8:17:22 AM7/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Python Google Chart
Hi guys,
I am trying to create a bar chart where the y-axis could go up to 30
million? (the graph is drawing number of search request - based on
request type, so a normal search maybe 20 million a days and the
remaining 10 million is spread across the other search types).
The problem I am having is getting the graph to be drawn at a good
screen size currently 800*375, however it doesnt show the y or x axis.
the code is below:
def resultShow(self):
cursor = self.db.cursor()
searchType = ["RTXML001", "RTXML002", "RTXML003", "RTXML004",
"RTXML005", "RTXML006", \
"RTXML007", "RTXML008", "RTXML009", "RTXML013",
"RTXML014", "RTXML016", \
"RTXML017", "RTXML018", "RTXML019", "RTXML020",
"RTXML021", "RTXML023", \
"RTXML024", "RTXML025", "RTXML026", "RTXML027",
"RTXML028", "RTXML029", \
"RTXML030", "RTXML031", "RTXML032", "RTXML033",
"RTXML101", "RTXML102", \
"RTXML103", "RTXML206", "RTXML207", "RTXML208",
"RTXML209"]
outputResult = []
for i in searchType:
cursor.execute ("select COUNT(SubCoreTable) FROM
SubCoreTable WHERE subrequestcode=%s;", (i,))
result = cursor.fetchone()
output = int(result[0])
outputResult.append(output)
chart = StackedVerticalBarChart(800, 375)
chart.set_axis_rang(y)
chart.add_data(outputResult)
#chart.set_pie_labels(searchType)
chart.download(self.ROOTPATH+'/SearchType.png')