tx3bas commited on
Commit
1e48da9
verified
1 Parent(s): 2fbd308

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -65,10 +65,9 @@ with st.sidebar.expander("Opciones Adicionales"):
65
  opacity = st.slider("Opacidad (%)", min_value=0, max_value=100, value=30, step=1) / 100
66
  border_width = st.slider("Grosor del Borde", min_value=0.0, max_value=3.0, value=1.5, step=0.1)
67
  border_opacity = st.slider("Opacidad del Borde (%)", min_value=0, max_value=100, value=60, step=1) / 100
 
68
  if chart_type == "Barras" and num_y_vars > 1:
69
- stacked_bars = st.checkbox("Apiladas", key="stacked_bars")
70
- else:
71
- stacked_bars = False
72
  if chart_type == "Barras":
73
  horizontal_bars = st.checkbox("Invertidas", key="horizontal_bars")
74
  if chart_type == "Donut":
@@ -113,8 +112,8 @@ common_layout = dict(
113
  width=graph_width,
114
  height=graph_height,
115
  margin=dict(l=60, r=40, t=100, b=40),
116
- xaxis=dict(showgrid=True, zeroline=True, gridcolor='rgba(211,211,211,0.5)', zerolinecolor='rgba(128,128,128,0.5)', autorange=True),
117
- yaxis=dict(showgrid=True, zeroline=True, gridcolor='rgba(211,211,211,0.5)', zerolinecolor='rgba(128,128,128,0.5)', autorange=True),
118
  font=dict(family=font_family, size=18, color="black"),
119
  showlegend=show_legend,
120
  legend=dict(orientation="v", yanchor="top", y=1, xanchor="left", x=1.02)
@@ -153,9 +152,9 @@ elif chart_type == "Dispersi贸n":
153
 
154
  elif chart_type == "Barras":
155
  if horizontal_bars:
156
- fig = px.bar(data, x=y_names_list, y="X", orientation='h', barmode='stack' if stacked_bars else 'group')
157
  else:
158
- fig = px.bar(data, x="X", y=y_names_list, barmode='stack' if stacked_bars else 'group')
159
  fig.update_traces(hovertemplate=hovertemplate)
160
  if use_multiple_colors:
161
  for i, trace in enumerate(fig.data):
 
65
  opacity = st.slider("Opacidad (%)", min_value=0, max_value=100, value=30, step=1) / 100
66
  border_width = st.slider("Grosor del Borde", min_value=0.0, max_value=3.0, value=1.5, step=0.1)
67
  border_opacity = st.slider("Opacidad del Borde (%)", min_value=0, max_value=100, value=60, step=1) / 100
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":
 
112
  width=graph_width,
113
  height=graph_height,
114
  margin=dict(l=60, r=40, t=100, b=40),
115
+ xaxis=dict(showgrid=show_grid, zeroline=True, gridcolor='rgba(211,211,211,0.5)', zerolinecolor='rgba(128,128,128,0.5)', autorange=True),
116
+ yaxis=dict(showgrid=show_grid, zeroline=True, gridcolor='rgba(211,211,211,0.5)', zerolinecolor='rgba(128,128,128,0.5)', autorange=True),
117
  font=dict(family=font_family, size=18, color="black"),
118
  showlegend=show_legend,
119
  legend=dict(orientation="v", yanchor="top", y=1, xanchor="left", x=1.02)
 
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):