Multichem commited on
Commit
67809c5
·
verified ·
1 Parent(s): 3fd5c1a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -12,6 +12,7 @@ import gspread
12
  import pymongo
13
  import time
14
  from pymongo.mongo_client import MongoClient
 
15
  import certifi
16
  ca = certifi.where()
17
 
@@ -42,7 +43,7 @@ gcservice_account, uri = init_conn()
42
 
43
  percentages_format = {'PG': '{:.2%}', 'SG': '{:.2%}', 'SF': '{:.2%}', 'PF': '{:.2%}', 'C': '{:.2%}'}
44
 
45
- @st.cache_resource(ttl = 599)
46
  def init_baselines():
47
 
48
  # Create a new client and connect to the server
@@ -702,7 +703,9 @@ with tab3:
702
 
703
  if plot_count == "One":
704
  graph_data = working_data.reindex(['Date', plot_var1],axis="columns")
705
- st.line_chart(graph_data, x="Date", y=plot_var1)
 
 
706
  elif plot_count == "Two":
707
  graph_data = working_data.reindex(['Date', plot_var1, plot_var2],axis="columns")
708
  st.line_chart(graph_data, x="Date", y=[plot_var1, plot_var2], color=["#FF0000", "#0000FF"])
 
12
  import pymongo
13
  import time
14
  from pymongo.mongo_client import MongoClient
15
+ import matplotlib.pyplot as plt
16
  import certifi
17
  ca = certifi.where()
18
 
 
43
 
44
  percentages_format = {'PG': '{:.2%}', 'SG': '{:.2%}', 'SF': '{:.2%}', 'PF': '{:.2%}', 'C': '{:.2%}'}
45
 
46
+ @st.cache_resource(ttl = 600)
47
  def init_baselines():
48
 
49
  # Create a new client and connect to the server
 
703
 
704
  if plot_count == "One":
705
  graph_data = working_data.reindex(['Date', plot_var1],axis="columns")
706
+ fig, ax = plt.subplots()
707
+ ax.line(graph_data)
708
+ st.pyplot(fig)
709
  elif plot_count == "Two":
710
  graph_data = working_data.reindex(['Date', plot_var1, plot_var2],axis="columns")
711
  st.line_chart(graph_data, x="Date", y=[plot_var1, plot_var2], color=["#FF0000", "#0000FF"])