My current code is
def drawBarChart(b1, b2, b3):
x = 300
y = 320
if b1 > y:
y = b1 + 100
if b2 > y:
y = b2 + 100
if b3 > y:
y = b3 + 100
pic1 = makeEmptyPicture(x, y)
bar(pic1, 60, b1, 40, red)
bar(pic1, 140, b2, 40, blue)
bar(pic1, 220, b3, 40, green)
show(pic1)
def bar(pic1, startX, c, width, colour):
y = 320
if c > y:
y = c
addRectFilled(pic1, startX, 0, width, c, colour)
and while it works in creating three different coloured bars, they're all upside down (they start at the top of the picture). Is there something I'm doing that's making them start at the top? I'm a beginner, so please try not to add in libraries, or any advanced stuff. My code must be in the format it's in, as it's for a school assignment.