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", "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)
|
|
@@ -117,12 +117,9 @@ if superposed:
|
|
| 117 |
if time_format == "Año":
|
| 118 |
tickformat = "%Y"
|
| 119 |
dtick = "M12" # Intervalo de 1 año
|
| 120 |
-
|
| 121 |
tickformat = "%b %Y"
|
| 122 |
dtick = "M1" # Intervalo de 1 mes
|
| 123 |
-
else: # "Día, Mes y Año"
|
| 124 |
-
tickformat = "%d %b %Y"
|
| 125 |
-
dtick = "D1" # Intervalo de 1 día
|
| 126 |
|
| 127 |
# Configuración de líneas de rejilla
|
| 128 |
grid_style = dict(showgrid=show_grid)
|
|
@@ -154,4 +151,4 @@ fig.update_layout(
|
|
| 154 |
st.plotly_chart(fig)
|
| 155 |
|
| 156 |
# Información adicional
|
| 157 |
-
st.write("Aquí puede añadir información adicional sobre los gráficos generados.")
|
|
|
|
| 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"])
|
| 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)
|
|
|
|
| 117 |
if time_format == "Año":
|
| 118 |
tickformat = "%Y"
|
| 119 |
dtick = "M12" # Intervalo de 1 año
|
| 120 |
+
else: # "Mes y Año"
|
| 121 |
tickformat = "%b %Y"
|
| 122 |
dtick = "M1" # Intervalo de 1 mes
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
# Configuración de líneas de rejilla
|
| 125 |
grid_style = dict(showgrid=show_grid)
|
|
|
|
| 151 |
st.plotly_chart(fig)
|
| 152 |
|
| 153 |
# Información adicional
|
| 154 |
+
st.write("Aquí puede añadir información adicional sobre los gráficos generados.")
|