1
I have a graphic of matplotlib put in format (pizza) and I wanted to take the picture and add it to Tkinter matplotlib.use("Tkagg")
DataBaser.cursor.execute("""
SELECT RendaMensal FROM Registro
Where Status = 'On'
""")
RendaGet = DataBaser.cursor.fetchone()
Renda = RendaGet[0]
print(Renda)
DataBaser.cursor.execute("""
SELECT TotalDebt FROM Registro
Where Status = 'On'
""")
TotalDebt = DataBaser.cursor.fetchone()
Debt = TotalDebt[0]
print(Debt)
sizes = [Debt, Renda]
labels = 'Gastos', 'Renda'
fig1, axl = plt.subplots()
colors = ['red', 'green']
c2 = axl.pie(sizes, labels=labels, autopct='%0.0f%%', shadow=False, startangle=90, colors=colors)
axl.axis('equal')
circle = axl.axis('equal')
#plt.xticks(Renda)
plt.title("Controle do Limite")
plt.show()
canvas = FigureCanvasTkAgg(c2, DataFrame)
canvas.draw()
canvas.get_tk_widget().pack(side=LEFT, fill=BOTH, expand=True)
#canvas._tkcanvas.pack(side=tk.BOTTOM, fill=tk.BOTH, expand = True)