Olav234
unread,Feb 16, 2011, 5:48:16 PM2/16/11Sign 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
First off, great job on this wrapper. Its been super handy for me.
I am attempting to get scaling to work properly on a grouped bar
chart. Here is my code:
As you can see, the markers on the top of each bar are displaying
scaled to 100 numbers, and the bars don't seem to be the correct
height either. Can anyone help me?
Thanks!
from pygooglechart import Chart
from pygooglechart import Axis
from pygooglechart import GroupedVerticalBarChart
def grouped_vertical():
max = 30
chart = GroupedVerticalBarChart(850, 300)
chart.set_bar_width(20)
chart.set_colours(['00ff00', 'ff0000'])
chart.add_data([1,2,3,4,5])
chart.add_data([1,4,9,16,25])
chart.add_marker(0, -1, 'N*f0', '000000', 10)
chart.add_marker(1, -1, 'N*f0', '000000', 10)
chart.set_grid(0, 5, 5, 5)
x_axis = ['Jan-2010', 'Feb-2010', 'Mar-2010', 'Apr-2010',
'May-2010']
chart.set_axis_labels(Axis.BOTTOM, x_axis)
left_axis = range(0, max+1, 5)
left_axis[0] = ''
chart.set_axis_labels(Axis.LEFT, left_axis)
chart.set_legend(['New Users', 'Active Users'])
chart.set_title('New and Active Users per Month')
print chart.get_url()
chart.download('bar-vertical-grouped.png')
grouped_vertical()