-
Notifications
You must be signed in to change notification settings - Fork 0
/
myapp.py
38 lines (30 loc) · 1.14 KB
/
myapp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import pandas as pd
import dash_core_components as dcc
import dash_html_components as html
import plotly
import datetime
import plotly.graph_objs as go
from collections import deque
import pandas_datareader.data as web
import dash
app = dash.Dash(r'Student Loans Data')
server = app.server
# external_css = ["https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css"]
# external_js = ['https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js']
# app = dash.Dash('loansdata',
# external_scripts=external_js,
# external_stylesheets=external_css)
df = pd.read_excel(r'C:\Users\mcket\OneDrive\Documents\GitHub\dashapplications\student_loans.xls')
print(df)
app.layout = html.Div([
html.H1('Student Loans Data'),
dcc.Graph(id='loans',
figure ={
'data':[{'x': df['observation_date'],'y':df['SLOAS'],'type':'line','name':'boats'}],
'layout':{
'title':'Total Student Loans Trend'
}
})
])
if __name__ =='__main__':
app.run_server(debug=True)