Esempio n. 1
0
def showStoreSales():
    makePlot(file=__file__,
             type="pie",
             title="Ventas de la tienda",
             file_name="tienda",
             show=True,
             pie_sections=[{
                 "name": "Leche",
                 "size": 12,
                 "explode": 0
             }, {
                 "name": "Huevo",
                 "size": 8,
                 "explode": 0
             }, {
                 "name": "Vino",
                 "size": 4,
                 "explode": 0
             }, {
                 "name": "Arroz",
                 "size": 26,
                 "explode": 0
             }, {
                 "name": "Queso",
                 "size": 30,
                 "explode": 0.1
             }, {
                 "name": "Salchichas",
                 "size": 20,
                 "explode": 0
             }])
def showSites():
    makePlot(file=__file__,
             type="pie",
             title="Tiempo en habitaciones",
             file_name="habitaciones",
             show=True,
             pie_sections=[{
                 "name": "Habitación",
                 "size": 70,
                 "explode": 0.1
             }, {
                 "name": "Terraza",
                 "size": 12,
                 "explode": 0
             }, {
                 "name": "acera",
                 "size": 8,
                 "explode": 0
             }, {
                 "name": "Cocina",
                 "size": 6,
                 "explode": 0
             }, {
                 "name": "Baño",
                 "size": 4,
                 "explode": 0
             }])
Esempio n. 3
0
def showStock(arroz, lentejas, frijoles, papa):
    names = ["arroz", "lentejas", "frijoles", "papa"]
    items = [arroz, lentejas, frijoles, papa]

    makePlot(file=__file__,
             type="bar",
             title="Inventario",
             file_name="Inventario",
             show=True,
             x_axis=["Elemento", names],
             y_axis=["Cantidad en Kg", items])
def comparePeaks():
    graphs = ["PPG", "ECG", "EEG"]
    peaks = [9, 9, 10]

    makePlot(file=__file__,
             type="bar",
             title="Picos en las graficas",
             file_name="picos",
             show=True,
             x_axis=["Grafica", graphs],
             y_axis=["Picos", peaks])
Esempio n. 5
0
def createPlot(plot_type, plot_title, file_name, rotate_ticks, x_axis, y_axis,
               **kwargs):
    try:
        if (kwargs["sections"] != []):
            makePlot(file=__file__,
                     type=plot_type,
                     title=plot_title,
                     file_name=file_name,
                     show=True,
                     rotate_x_ticks=rotate_ticks,
                     size=kwargs["file_size"],
                     pie_sections=kwargs["sections"])
        else:
            makePlot(file=__file__,
                     type=plot_type,
                     title=plot_title,
                     file_name=file_name,
                     show=True,
                     rotate_x_ticks=rotate_ticks,
                     size=kwargs["file_size"],
                     legend=kwargs["legend"],
                     x_axis=x_axis,
                     y_axis=y_axis)
    except ValueError as e:
        exception_string = str(e)

        if (NOT_ENOUGH_EXCEPTION["description"] in exception_string):
            message = NOT_ENOUGH_EXCEPTION["message"].format(
                len(kwargs["file_size"]))

        elif (TOO_MANY_EXCEPTION["description"] in exception_string):
            message = TOO_MANY_EXCEPTION["message"].format(
                len(kwargs["file_size"]))

        else:
            message = exception_string

        messagebox.showerror(ERROR_MESSAGEBOX_TITLES["createPlot"], message)
        return False
import os
import sys

# esto es para que reconosca el archivo de funciones
sys.path.append(os.getcwd() + "/functions/")
from funcs import readCSV, makePlot

invetario = readCSV("inventario")
ppg = readCSV("ppg")

# BARRA
makePlot(file=__file__,
         type="bar",
         title="Elemento vs Unidades",
         file_name="Elemento vs Unidades",
         rotate_x_ticks=True,
         size=[7, 13],
         x_axis=["Elemento", list(invetario["Elemento"].values())],
         y_axis=["Unidades", list(invetario["Unidade "].values())])

makePlot(file=__file__,
         type="bar",
         title="Elemento vs Elementos Viejos",
         file_name="Elemento vs Elementos Viejos",
         rotate_x_ticks=True,
         size=[7, 13],
         x_axis=["Elemento", list(invetario["Elemento"].values())],
         y_axis=["Elementos Viejos",
                 list(invetario["Viejo "].values())])

makePlot(file=__file__,
Esempio n. 7
0
# esto es para que reconosca el archivo de funciones
sys.path.append(os.getcwd() + "/functions/")
from funcs import readCSV, makePlot


barrios = readCSV("barrios.csv")
ecg = readCSV("ecg_taller.csv")

makePlot(
    file=__file__,
    type="bar",
    title="Barrios vs Agua",
    file_name="Barrios vs Agua",
    rotate_x_ticks=True,
    size=[7,12],
    x_axis = [
        "Barrios",
        list(barrios["Barrio"].values())
    ],
    y_axis = [
        "Agua",
        list(barrios["Agua"].values())
    ]
)

makePlot(
    file=__file__,
    type="bar",
    title="Barrios vs Gas",
    file_name="Barrios vs Gas",
    rotate_x_ticks=True,
    size=[7,12],