Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ st.sidebar.header("Configuración del Gráfico")
|
|
| 29 |
chart_title = st.sidebar.text_input("Título del Gráfico", "Gráfico de Franjas de Tiempo")
|
| 30 |
|
| 31 |
# Seleccionar formato de tiempo
|
| 32 |
-
time_format = st.sidebar.selectbox("Formato de Tiempo", ["Año"])
|
| 33 |
|
| 34 |
# Ingresar valores para franjas de tiempo
|
| 35 |
num_y_vars = st.sidebar.number_input("Número de Variables Y", min_value=1, max_value=30, value=3, step=1)
|
|
@@ -113,14 +113,13 @@ for idx, row in data.iterrows():
|
|
| 113 |
if superposed:
|
| 114 |
fig.update_traces(marker=dict(line_width=bar_width * 5)) # Ajusta el ancho de la barra en modo superpuesto
|
| 115 |
|
| 116 |
-
# Actualizar el diseño del gráfico
|
| 117 |
-
fig.update_yaxes(categoryorder="total ascending")
|
| 118 |
-
|
| 119 |
# Personalizar el formato de tiempo en el eje X
|
| 120 |
if time_format == "Año":
|
| 121 |
tickformat = "%Y"
|
| 122 |
-
|
| 123 |
-
tickformat = "%Y
|
|
|
|
|
|
|
| 124 |
|
| 125 |
# Configuración de líneas de rejilla
|
| 126 |
grid_style = dict(showgrid=show_grid)
|
|
|
|
| 29 |
chart_title = st.sidebar.text_input("Título del Gráfico", "Gráfico de Franjas de Tiempo")
|
| 30 |
|
| 31 |
# Seleccionar formato de tiempo
|
| 32 |
+
time_format = st.sidebar.selectbox("Formato de Tiempo", ["Año", "Mes y Año", "Día, Mes y Año"])
|
| 33 |
|
| 34 |
# Ingresar valores para franjas de tiempo
|
| 35 |
num_y_vars = st.sidebar.number_input("Número de Variables Y", min_value=1, max_value=30, value=3, step=1)
|
|
|
|
| 113 |
if superposed:
|
| 114 |
fig.update_traces(marker=dict(line_width=bar_width * 5)) # Ajusta el ancho de la barra en modo superpuesto
|
| 115 |
|
|
|
|
|
|
|
|
|
|
| 116 |
# Personalizar el formato de tiempo en el eje X
|
| 117 |
if time_format == "Año":
|
| 118 |
tickformat = "%Y"
|
| 119 |
+
elif time_format == "Mes y Año":
|
| 120 |
+
tickformat = "%b %Y"
|
| 121 |
+
else: # "Día, Mes y Año"
|
| 122 |
+
tickformat = "%d %b %Y"
|
| 123 |
|
| 124 |
# Configuración de líneas de rejilla
|
| 125 |
grid_style = dict(showgrid=show_grid)
|