Penzar commited on
Commit
e854deb
·
verified ·
1 Parent(s): f25c4f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -15
app.py CHANGED
@@ -2,7 +2,10 @@ 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)
@@ -11,7 +14,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 +25,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 +35,26 @@ 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
+ # Set page layout to wide
6
+ st.set_page_config(layout="wide")
7
+
8
+ st.title("CEO Dashboard")
9
 
10
  # Existing metric cards code
11
  col1, col2, col3, col4 = st.columns(4)
 
14
  col3.metric("Cost", "101500", "4%")
15
  col4.metric("Profit", "145471", "10%")
16
 
17
+ # Fake data for the bar charts
18
  data1 = pd.DataFrame({
19
  'QTR': ['Q1', 'Q2', 'Q3', 'Q4'],
20
  'Market Share': np.random.randint(10, 20, size=4)
 
25
  'Market Share': np.random.randint(20, 30, size=4)
26
  })
27
 
 
 
 
 
 
 
 
 
 
 
28
  data3 = pd.DataFrame({
29
  'QTR': ['Q1', 'Q2', 'Q3', 'Q4'],
30
  'Market Share': np.random.randint(30, 40, size=4)
 
35
  'Market Share': np.random.randint(40, 50, size=4)
36
  })
37
 
38
+ # Reduced height for the bar charts
39
+ chart_height = 200
40
+
41
+ # Creating the bar charts
42
+ col1, col2 = st.columns(2)
43
+
44
+ with col1:
45
+ st.write("Kuch tho bhi1")
46
+ st.bar_chart(data1.set_index('QTR'), height=chart_height)
47
+
48
+ with col2:
49
+ st.write("Kuch tho bhi1")
50
+ st.bar_chart(data2.set_index('QTR'), height=chart_height)
51
+
52
  col3, col4 = st.columns(2)
53
 
54
  with col3:
55
+ st.write("Kuch tho bhi1")
56
+ st.bar_chart(data3.set_index('QTR'), height=chart_height)
57
 
58
  with col4:
59
+ st.write("Kuch tho bhi1")
60
+ st.bar_chart(data4.set_index('QTR'), height=chart_height)