46
46
count = i.get('done', 0) + i.get('todo', 0) + i.get('postponed', 0)
47
47
if max_items < count:
49
pcdata.append((date, i.get('todo', 0), i.get('done', 0), i.get('postponed', 0), count))
49
pcdata.append((date, i.get('todo_teamonly', 0), i.get('todo', 0),
50
i.get('done_teamonly', 0), i.get('done', 0),
51
i.get('postponed_teamonly', 0), i.get('postponed', 0), count))
51
53
# add some extra space to look nicer
52
54
max_items = int(max_items * 1.05)
81
83
# for each column of data, tell it what to use for the legend and
82
84
# what color to make the bar, no lines, and
83
85
# what plot to stack on
84
plot1 = bar_plot.T(label='todo', hcol=1)
85
plot1.fill_style = fill_style.red
86
plot1 = bar_plot.T(label='todo (team)', hcol=1)
87
plot1.fill_style = fill_style.Plain(bgcolor=color.red)
86
88
plot1.line_style = None
87
plot2 = bar_plot.T(label='done', hcol=2, stack_on = plot1)
88
plot2.fill_style = fill_style.green
89
plot2 = bar_plot.T(label='todo (foreign)', hcol=2)
90
plot2.fill_style = fill_style.Plain(bgcolor=color.coral1)
89
91
plot2.line_style = None
90
plot3 = bar_plot.T(label="postponed", hcol=3, stack_on = plot2)
91
plot3.fill_style = fill_style.yellow
93
plot3 = bar_plot.T(label='done (team)', hcol=3, stack_on = plot2)
94
plot3.fill_style = fill_style.green
92
95
plot3.line_style = None
93
plot4 = bar_plot.T(label='total', hcol=4)
94
plot4.fill_style = None
95
plot4.line_style = line_style.gray30
96
plot4 = bar_plot.T(label='done (foreign)', hcol=4, stack_on = plot2)
97
plot4.fill_style = fill_style.Plain(bgcolor=color.olivedrab1)
98
plot4.line_style = None
100
plot5 = bar_plot.T(label="postponed (team)", hcol=5, stack_on = plot4)
101
plot5.fill_style = fill_style.Plain(bgcolor=color.yellow2)
102
plot5.line_style = None
103
plot6 = bar_plot.T(label="postponed (foreign) ", hcol=6, stack_on = plot4)
104
plot6.fill_style = fill_style.Plain(bgcolor=color.yellow1)
105
plot6.line_style = None
107
plot7 = bar_plot.T(label='total', hcol=7)
108
plot7.fill_style = None
109
plot7.line_style = line_style.gray30
97
111
# create the canvas with the specified filename and file format
98
112
can = canvas.init(filename,format)
100
114
# add the data to the area and draw it
101
ar.add_plot(plot1, plot2, plot3, plot4)
115
ar.add_plot(plot2, plot1, plot4, plot3, plot6, plot5, plot7)
104
118
# create and arrow for the trend line