import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
import warnings
warnings.filterwarnings("ignore")
import datetime
from datetime import date
import seaborn as sns
import calendar
import matplotlib.dates as mdates
import plotly.express as px

data = pd.read_excel(r'C:\Users\stani\Desktop\Webapp\st_zagora\data_for_python2.xlsx') 
df = pd.DataFrame(data)
#st.write(df["production cost"])
#df["production cost"]
df1 = df.head(3)
st.write(df1["production cost"])

#import plotly.express as px

wide_df = px.data.medals_wide()

fig = px.bar(wide_df, x="nation", y=["gold", "silver", "bronze"], title="Wide-Form Input")
fig.show()

# show the dataframe

column_headers = list(df.columns.values)
xx1=column_headers[0]
#st.write(xx1)
#yy1 = df['production_cost']
#ax1 = df.plot.area(x='data', y='month_flow',stacked=False)
# Get the angles from 0 to 2 pie (360 degree) in narray object
#X = np.arange(0, math.pi*2, 0.05)
#st.write(yy1)
# Using built-in trigonometric function we can directly plot
# the given cosine wave for the given angles
#Y1 = np.sin(X)
#Y2 = np.cos(X)
#Y3 = np.tan(X)
#Y4 = np.tanh(X)
#ax1=y1.plot.bar(stacked=True).figure, plt.xticks(rotation=0)  
# Initialise the subplot function using number of rows and columns
#figure, axis = plt.subplots(2, 2)
  
# For Sine Function
#ax = df.plot.bar(stacked=True)
#axis[0, 0]=yy1.plot(kind='bar', stacked=True)




#axis[0, 0].yy1.plot.bar(stacked=True)
#axis[0, 0].set_title("Sine Function")
#axis[0, 0].plot.bar(stacked=True).figure, plt.xticks(rotation=0)
#plot.area(x='data', y='month_flow', stacked=True)
  
# For Cosine Function
#axis[0, 1].plot(X, Y2)
#axis[0, 1].set_title("Cosine Function")
  
# For Tangent Function
#axis[1, 0].plot(X, Y3)
#axis[1, 0].set_title("Tangent Function")
  
# For Tanh Function
#axis[1, 1].plot(X, Y4)
#axis[1, 1].set_title("Tanh Function")
  
# Combine all the operations and display
#plt.show()
#st.pyplot(figure)
