tx3bas commited on
Commit
5ca2a0d
verified
1 Parent(s): 8a0fb57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -14
app.py CHANGED
@@ -110,10 +110,6 @@ else:
110
  for idx, y_set in enumerate(y_values_lists):
111
  data[y_names_list[idx]] = y_set
112
 
113
- # Calcular el rango del eje Y
114
- y_min, y_max = min(min(y_set) for y_set in y_values_lists), max(max(y_set) for y_set in y_values_lists)
115
- y_min, y_max = calculate_y_range([y_min, y_max])
116
-
117
  # Configuraci贸n com煤n para todos los gr谩ficos
118
  common_layout = dict(
119
  xaxis_title=x_label,
@@ -199,16 +195,19 @@ else:
199
 
200
  # A帽adir anotaci贸n para el t铆tulo
201
  if chart_type != "Donut":
202
- fig.add_annotation(
203
- text=f"{chart_title}",
204
- xref="paper", yref="paper",
205
- x=0.5, y=1.15,
206
- showarrow=False,
207
- font=dict(
208
- family=font_family,
209
- size=18,
210
- color="#374151",
211
- weight="normal"
 
 
 
212
  )
213
  )
214
 
@@ -231,6 +230,9 @@ else:
231
  # Mostrar el gr谩fico
232
  st.plotly_chart(fig)
233
 
 
 
 
234
  # Informaci贸n adicional
235
  st.write("""
236
  """)
 
110
  for idx, y_set in enumerate(y_values_lists):
111
  data[y_names_list[idx]] = y_set
112
 
 
 
 
 
113
  # Configuraci贸n com煤n para todos los gr谩ficos
114
  common_layout = dict(
115
  xaxis_title=x_label,
 
195
 
196
  # A帽adir anotaci贸n para el t铆tulo
197
  if chart_type != "Donut":
198
+ fig.update_layout(
199
+ title=dict(
200
+ text=f"{chart_title}",
201
+ x=0.5,
202
+ y=0.95,
203
+ xanchor='center',
204
+ yanchor='top',
205
+ font=dict(
206
+ family=font_family,
207
+ size=18,
208
+ color="#374151",
209
+ weight="normal"
210
+ )
211
  )
212
  )
213
 
 
230
  # Mostrar el gr谩fico
231
  st.plotly_chart(fig)
232
 
233
+ # Forzar el autoescale
234
+ fig.update_layout(xaxis_autorange=True, yaxis_autorange=True)
235
+
236
  # Informaci贸n adicional
237
  st.write("""
238
  """)