KunaalNaik commited on
Commit
33bd81d
1 Parent(s): 1cc7896

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  import pandas as pd
3
  import numpy as np
 
4
 
5
  # Set page layout to wide
6
  st.set_page_config(layout="wide")
@@ -24,9 +25,9 @@ kpi4_percentage = df['Profit'].iloc[-1]/df['Profit'].iloc[-2]-1
24
  # Existing metric cards code
25
  col1, col2, col3, col4 = st.columns(4)
26
  col1.metric("Market Share", kpi1_value, kpi1_percentage)
27
- col2.metric("Revenue", kpi2_value, kpi1_percentage)
28
- col3.metric("Cost", kpi3_value, kpi1_percentage)
29
- col4.metric("Profit", kpi4_value, kpi1_percentage)
30
 
31
  # Fake data for the bar charts
32
  data1 = pd.DataFrame({
@@ -57,7 +58,14 @@ col1, col2 = st.columns(2)
57
 
58
  with col1:
59
  st.write("Kuch tho bhi1")
60
- st.bar_chart(data1.set_index('QTR'), height=chart_height)
 
 
 
 
 
 
 
61
 
62
  with col2:
63
  st.write("Kuch tho bhi1")
 
1
  import streamlit as st
2
  import pandas as pd
3
  import numpy as np
4
+ import matplotlib.pyplot as plt
5
 
6
  # Set page layout to wide
7
  st.set_page_config(layout="wide")
 
25
  # Existing metric cards code
26
  col1, col2, col3, col4 = st.columns(4)
27
  col1.metric("Market Share", kpi1_value, kpi1_percentage)
28
+ col2.metric("Revenue", kpi2_value, kpi2_percentage)
29
+ col3.metric("Cost", kpi3_value, kpi3_percentage)
30
+ col4.metric("Profit", kpi4_value, kpi4_percentage)
31
 
32
  # Fake data for the bar charts
33
  data1 = pd.DataFrame({
 
58
 
59
  with col1:
60
  st.write("Kuch tho bhi1")
61
+ # Plotting with Matplotlib
62
+ fig, ax = plt.subplots()
63
+ df['Overall Revenue Growth'].plot(kind='bar', ax=ax)
64
+ ax.set_title('Overall Revenue Growth for the Last 4 Quarters')
65
+ ax.set_ylabel('Overall Revenue Growth (%)')
66
+
67
+ # Display the plot in the Streamlit app
68
+ st.pyplot(fig)
69
 
70
  with col2:
71
  st.write("Kuch tho bhi1")