Update Home.py
Browse files
Home.py
CHANGED
|
@@ -170,10 +170,11 @@ try:
|
|
| 170 |
# Horizontal bar chart with Altair
|
| 171 |
chart_ins = (
|
| 172 |
alt.Chart(inst_counts)
|
| 173 |
-
.
|
| 174 |
.encode(
|
| 175 |
-
|
| 176 |
-
|
|
|
|
| 177 |
)
|
| 178 |
)
|
| 179 |
|
|
@@ -239,13 +240,13 @@ try:
|
|
| 239 |
|
| 240 |
# layout
|
| 241 |
col1, col2 = st.columns(2)
|
| 242 |
-
with col1.container(border=True):
|
| 243 |
-
st.bar_chart(jrnl_counts_df)
|
| 244 |
-
with col2.container(border=True):
|
| 245 |
-
st.
|
| 246 |
-
with col1.container(border=True):
|
| 247 |
st.altair_chart(chart_ins, use_container_width=True)
|
| 248 |
-
with col2.container(border=True):
|
| 249 |
st.altair_chart(chart_aut, use_container_width=True)
|
| 250 |
|
| 251 |
|
|
|
|
| 170 |
# Horizontal bar chart with Altair
|
| 171 |
chart_ins = (
|
| 172 |
alt.Chart(inst_counts)
|
| 173 |
+
.mark_arc()
|
| 174 |
.encode(
|
| 175 |
+
theta="Count:Q", # besar irisan
|
| 176 |
+
color="Institution:N", # warna berdasarkan institusi
|
| 177 |
+
tooltip=["Institution", "Count"] # tampilkan info saat hover
|
| 178 |
)
|
| 179 |
)
|
| 180 |
|
|
|
|
| 240 |
|
| 241 |
# layout
|
| 242 |
col1, col2 = st.columns(2)
|
| 243 |
+
with col1.container(border=True, gap="medium"):
|
| 244 |
+
st.bar_chart(jrnl_counts_df, use_container_width=True, horizontal=True, width=600, height=600)
|
| 245 |
+
with col2.container(border=True, gap="medium"):
|
| 246 |
+
st.line_chart(year_counts_df, use_container_width=True, horizontal=True, width=600, height=600)
|
| 247 |
+
with col1.container(border=True, gap="medium"):
|
| 248 |
st.altair_chart(chart_ins, use_container_width=True)
|
| 249 |
+
with col2.container(border=True, gap="medium"):
|
| 250 |
st.altair_chart(chart_aut, use_container_width=True)
|
| 251 |
|
| 252 |
|