Roberta2024 commited on
Commit
5585581
·
verified ·
1 Parent(s): 46cea24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -68,7 +68,6 @@ if st.sidebar.button("載入並分析數據"):
68
  # Automatically select columns for visualization
69
  company_column = df.columns[0] # Assume the first column is the company name
70
  numeric_columns = df.select_dtypes(include=['int64', 'float64']).columns
71
-
72
  if len(numeric_columns) > 0:
73
  y_column = st.sidebar.selectbox("選擇數值欄位", options=numeric_columns)
74
 
@@ -90,9 +89,12 @@ if st.sidebar.button("載入並分析數據"):
90
  fig_bar.update_layout(
91
  font_family="Taipei Sans TC Beta",
92
  title_font_size=24,
 
 
93
  legend_title_font_size=14,
94
  legend_font_size=12
95
  )
 
96
  st.plotly_chart(fig_bar, use_container_width=True)
97
  else:
98
  st.warning("沒有足夠的數值型欄位來創建圖表。請選擇另一個數據集。")
@@ -110,4 +112,4 @@ else:
110
 
111
  # Footer
112
  st.markdown("---")
113
- st.markdown("使用 Streamlit 創建 ❤️")
 
68
  # Automatically select columns for visualization
69
  company_column = df.columns[0] # Assume the first column is the company name
70
  numeric_columns = df.select_dtypes(include=['int64', 'float64']).columns
 
71
  if len(numeric_columns) > 0:
72
  y_column = st.sidebar.selectbox("選擇數值欄位", options=numeric_columns)
73
 
 
89
  fig_bar.update_layout(
90
  font_family="Taipei Sans TC Beta",
91
  title_font_size=24,
92
+ xaxis_title="公司名稱",
93
+ yaxis_title=y_column,
94
  legend_title_font_size=14,
95
  legend_font_size=12
96
  )
97
+ fig_bar.update_xaxes(tickangle=45)
98
  st.plotly_chart(fig_bar, use_container_width=True)
99
  else:
100
  st.warning("沒有足夠的數值型欄位來創建圖表。請選擇另一個數據集。")
 
112
 
113
  # Footer
114
  st.markdown("---")
115
+ st.markdown("使用 Streamlit 創建 ❤️")