def getData():
    db = DataBase()
    data = db.getGoatRecords()
    dataColumns = db.getColumnNames()
    df = pd.DataFrame(data, columns=dataColumns)

    if not df['breed'].empty:
        breed = df['breed']
        gender = df['gender']
    else:
        breed = ['']
        gender = ['']

    kidCount = db.getKidCount()
    maleKidCount = 0
    femaleKidCount = 0

    if len(kidCount) > 1:
        if kidCount[0][1] == 'm':
            maleKidCount = kidCount[0][0]
            femaleKidCount = kidCount[1][0]
        else:
            maleKidCount = kidCount[1][0]
            femaleKidCount = kidCount[0][0]
    elif len(kidCount) == 1:
        if kidCount[0][1] == 'm':
            maleKidCount = kidCount[0][0]
        else:
            femaleKidCount = kidCount[0][0]
    else:
        maleKidCount = 0
        femaleKidCount = 0

    deadCount = db.getDeadCount()
    maleDeadCount = 0
    femaleDeadCount = 0

    if len(deadCount) > 1:
        if deadCount[0][1] == 'm':
            maleDeadCount = deadCount[0][0]
            femaleDeadCount = deadCount[1][0]
        else:
            maleDeadCount = deadCount[1][0]
            femaleDeadCount = deadCount[0][0]
    elif len(deadCount) == 1:
        if deadCount[0][1] == 'm':
            maleDeadCount = deadCount[0][0]
        else:
            femaleDeadCount = deadCount[0][0]
    else:
        maleDeadCount = 0
        femaleDeadCount = 0

    income = db.getTotalIncome() + db.getTotalSoldGoatsRate()
    expense = db.getTotalLabourCost() + db.getTotalFeedCost(
    ) + db.getTotalMiscExpenditure()

    db = None
    return breed, gender, maleKidCount, femaleKidCount, maleDeadCount, femaleDeadCount, income, expense
def displayMasterChart():
    try:
        from tkinter import Tk
        import tkMessageBox as messagebox
    except ImportError:
        from tkinter import Tk
        from tkinter import messagebox

    root = Tk()

    root.geometry("1500x760+0+0")
    root.minsize(800, 500)
    root.maxsize(1800, 850)
    root.resizable(1, 1)
    root.title("Master Chart")
    root.configure(background="#f3f3f3")
    root.configure(highlightbackground="#d9d9d9")
    root.configure(highlightcolor="#090000")

    Frame1 = Frame(root)
    Frame1.place(relx=0.0, rely=0.03, relheight=0.97, relwidth=1.0)
    Frame1.configure(relief='groove')
    Frame1.configure(borderwidth="2")
    Frame1.configure(relief="groove")
    Frame1.configure(background="#78909C")
    Frame1.configure(highlightbackground="#d9d9d9")
    Frame1.configure(highlightcolor="black")

    def on_select(data):
        menu.delete(0, 2)
        row_data = data
        # print(data)
        # print("\n")
        createMenu(row_data)
 
    db = DataBase()

    global menu
    menu = Menu(root, tearoff=0)

    def createMenu(row_data):
        menu.add_command(label="Update", command=lambda: updateGoat.create_Toplevel1(root, row_data))
        menu.add_separator()
        menu.add_command(label="View", command=lambda: view.create_Toplevel1(root, row_data))

    mc = Multicolumn_Listbox(Frame1, db.getColumnNames(), stripped_rows = ("white","#f2f2f2"), command=on_select, cell_anchor="center", height=600, adjust_heading_to_content=True)
    mc.interior.place(relx=0.0,rely=0,relheight= 0.97,relwidth=0.985)
    vsb = ttk.Scrollbar(Frame1, orient = "horizontal", command = mc.interior.xview)
    vsb.pack(side = 'bottom', fill= 'x')
    mc.interior.configure(xscrollcommand = vsb.set)

    def populateTree():
        for record in db.getGoatRecords():
            mc.insert_row(record)
    
    populateTree()

    def refreshPage():
        mc.clear()
        populateTree()


    Button3 = tk.Button(root)
    Button3.place(relx=0.870, rely=0.00, height=25, width=80)
    Button3.configure(activebackground="#ececec")
    Button3.configure(activeforeground="#000000")
    Button3.configure(background="#d9d9d9")
    Button3.configure(disabledforeground="#a3a3a3")
    Button3.configure(font="-family {Segoe UI} -size 14")
    Button3.configure(foreground="#000000")
    Button3.configure(highlightbackground="#d9d9d9")
    Button3.configure(highlightcolor="black")
    Button3.configure(pady="0")
    Button3.configure(text='''Refresh''')
    Button3.configure(command=refreshPage)

    root.mainloop()