tx3bas commited on
Commit
ec86661
verified
1 Parent(s): f169a3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -68,6 +68,8 @@ with st.sidebar.expander("Opciones Adicionales"):
68
  show_grid = st.checkbox("Activar rejilla", value=True)
69
  if chart_type == "Barras" and num_y_vars > 1:
70
  superposed_bars = st.checkbox("Superpuestas", value=True, key="superposed_bars")
 
 
71
  if chart_type == "Barras":
72
  horizontal_bars = st.checkbox("Invertidas", key="horizontal_bars")
73
  if chart_type == "Donut":
@@ -152,9 +154,9 @@ elif chart_type == "Dispersi贸n":
152
 
153
  elif chart_type == "Barras":
154
  if horizontal_bars:
155
- fig = px.bar(data, x=y_names_list, y="X", orientation='h', barmode='group' if not superposed_bars else 'overlay')
156
  else:
157
- fig = px.bar(data, x="X", y=y_names_list, barmode='group' if not superposed_bars else 'overlay')
158
  fig.update_traces(hovertemplate=hovertemplate)
159
  if use_multiple_colors:
160
  for i, trace in enumerate(fig.data):
 
68
  show_grid = st.checkbox("Activar rejilla", value=True)
69
  if chart_type == "Barras" and num_y_vars > 1:
70
  superposed_bars = st.checkbox("Superpuestas", value=True, key="superposed_bars")
71
+ else:
72
+ superposed_bars = False
73
  if chart_type == "Barras":
74
  horizontal_bars = st.checkbox("Invertidas", key="horizontal_bars")
75
  if chart_type == "Donut":
 
154
 
155
  elif chart_type == "Barras":
156
  if horizontal_bars:
157
+ fig = px.bar(data, x=y_names_list, y="X", orientation='h', barmode='overlay' if superposed_bars else 'group')
158
  else:
159
+ fig = px.bar(data, x="X", y=y_names_list, barmode='overlay' if superposed_bars else 'group')
160
  fig.update_traces(hovertemplate=hovertemplate)
161
  if use_multiple_colors:
162
  for i, trace in enumerate(fig.data):