Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,8 @@ import streamlit as st
|
|
| 2 |
import pandas as pd
|
| 3 |
import numpy as np
|
| 4 |
|
|
|
|
|
|
|
| 5 |
# Existing metric cards code
|
| 6 |
col1, col2, col3, col4 = st.columns(4)
|
| 7 |
col1.metric("Market Share", "14%", "1%")
|
|
@@ -9,7 +11,7 @@ col2.metric("Revenue", "246971", "14%")
|
|
| 9 |
col3.metric("Cost", "101500", "4%")
|
| 10 |
col4.metric("Profit", "145471", "10%")
|
| 11 |
|
| 12 |
-
# Fake data for the bar charts
|
| 13 |
data1 = pd.DataFrame({
|
| 14 |
'QTR': ['Q1', 'Q2', 'Q3', 'Q4'],
|
| 15 |
'Market Share': np.random.randint(10, 20, size=4)
|
|
@@ -20,7 +22,7 @@ data2 = pd.DataFrame({
|
|
| 20 |
'Market Share': np.random.randint(20, 30, size=4)
|
| 21 |
})
|
| 22 |
|
| 23 |
-
# Creating two bar charts
|
| 24 |
col1, col2 = st.columns(2)
|
| 25 |
|
| 26 |
with col1:
|
|
@@ -28,3 +30,23 @@ with col1:
|
|
| 28 |
|
| 29 |
with col2:
|
| 30 |
st.bar_chart(data2.set_index('QTR'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import pandas as pd
|
| 3 |
import numpy as np
|
| 4 |
|
| 5 |
+
st.title("CXO Dashboard")
|
| 6 |
+
|
| 7 |
# Existing metric cards code
|
| 8 |
col1, col2, col3, col4 = st.columns(4)
|
| 9 |
col1.metric("Market Share", "14%", "1%")
|
|
|
|
| 11 |
col3.metric("Cost", "101500", "4%")
|
| 12 |
col4.metric("Profit", "145471", "10%")
|
| 13 |
|
| 14 |
+
# Fake data for the first set of bar charts
|
| 15 |
data1 = pd.DataFrame({
|
| 16 |
'QTR': ['Q1', 'Q2', 'Q3', 'Q4'],
|
| 17 |
'Market Share': np.random.randint(10, 20, size=4)
|
|
|
|
| 22 |
'Market Share': np.random.randint(20, 30, size=4)
|
| 23 |
})
|
| 24 |
|
| 25 |
+
# Creating the first set of two bar charts
|
| 26 |
col1, col2 = st.columns(2)
|
| 27 |
|
| 28 |
with col1:
|
|
|
|
| 30 |
|
| 31 |
with col2:
|
| 32 |
st.bar_chart(data2.set_index('QTR'))
|
| 33 |
+
|
| 34 |
+
# Fake data for the second set of bar charts
|
| 35 |
+
data3 = pd.DataFrame({
|
| 36 |
+
'QTR': ['Q1', 'Q2', 'Q3', 'Q4'],
|
| 37 |
+
'Market Share': np.random.randint(30, 40, size=4)
|
| 38 |
+
})
|
| 39 |
+
|
| 40 |
+
data4 = pd.DataFrame({
|
| 41 |
+
'QTR': ['Q1', 'Q2', 'Q3', 'Q4'],
|
| 42 |
+
'Market Share': np.random.randint(40, 50, size=4)
|
| 43 |
+
})
|
| 44 |
+
|
| 45 |
+
# Creating the second set of two bar charts
|
| 46 |
+
col3, col4 = st.columns(2)
|
| 47 |
+
|
| 48 |
+
with col3:
|
| 49 |
+
st.bar_chart(data3.set_index('QTR'))
|
| 50 |
+
|
| 51 |
+
with col4:
|
| 52 |
+
st.bar_chart(data4.set_index('QTR'))
|