KunaalNaik commited on
Commit
a5b586d
1 Parent(s): 3b54297

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -16
app.py CHANGED
@@ -2,8 +2,6 @@ import streamlit as st
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,7 +9,7 @@ col2.metric("Revenue", "246971", "14%")
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,16 +20,6 @@ data2 = pd.DataFrame({
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:
29
- st.bar_chart(data1.set_index('QTR'))
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)
@@ -42,11 +30,22 @@ data4 = pd.DataFrame({
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'))
 
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
  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
  'Market Share': np.random.randint(20, 30, size=4)
21
  })
22
 
 
 
 
 
 
 
 
 
 
 
23
  data3 = pd.DataFrame({
24
  'QTR': ['Q1', 'Q2', 'Q3', 'Q4'],
25
  'Market Share': np.random.randint(30, 40, size=4)
 
30
  'Market Share': np.random.randint(40, 50, size=4)
31
  })
32
 
33
+ # Reduced height for the bar charts
34
+ chart_height = 200
35
+
36
+ # Creating the bar charts
37
+ col1, col2 = st.columns(2)
38
+
39
+ with col1:
40
+ st.bar_chart(data1.set_index('QTR'), height=chart_height)
41
+
42
+ with col2:
43
+ st.bar_chart(data2.set_index('QTR'), height=chart_height)
44
+
45
  col3, col4 = st.columns(2)
46
 
47
  with col3:
48
+ st.bar_chart(data3.set_index('QTR'), height=chart_height)
49
 
50
  with col4:
51
+ st.bar_chart(data4.set_index('QTR'), height=chart_height)