import tkinter
import csv
root = tkinter.Tk()
root.title("売り上げの推移")
ca = tkinter.Canvas(width=800, height=480, bg="white")
ca.pack()
f = open("売り上げデータ.csv",encoding="utf-8")
cr = csv.reader(f)
dat = list(cr)
f.close()
FNT = ("Times New Roman", 12)
bar_x = 40
bar_b = 320
for ye in range(1,6):
ca.create_rectangle(bar_x, bar_b+5, bar_x+140, bar_b+25, fill="gray", width=0)
ca.create_text(bar_x+70, bar_b+15, text=dat[0][ye], fill="white", font=FNT)
ca.create_rectangle(bar_x, bar_b, bar_x+140, bar_b-int(dat[13][ye])/24, fill="skyblue", width=0)
for mo in range(1,13):
h = int(dat[mo][ye])/6
ca.create_rectangle(bar_x, bar_b, bar_x+6, bar_b-h, fill="blue")
bar_x = bar_x + 12
root.mainloop()