Skip to content

Instantly share code, notes, and snippets.

@fnneves
Created May 11, 2021 16:56
Show Gist options
  • Save fnneves/0a097783d34d2824fbc96466d2dbf3ba to your computer and use it in GitHub Desktop.
Save fnneves/0a097783d34d2824fbc96466d2dbf3ba to your computer and use it in GitHub Desktop.
app = JupyterDash(__name__, external_stylesheets=[dbc.themes.FLATLY])
app.layout = dbc.Container(
[
dbc.Row(dbc.Col(html.H2('PORTFOLIO OVERVIEW', className='text-center text-primary, mb-3'))), # header row
dbc.Row([ # start of second row
dbc.Col([ # first column on second row
html.H5('Total Portfolio Value ($USD)', className='text-center'),
dcc.Graph(id='chrt-portfolio-main',
figure=chart_ptfvalue,
style={'height':550}),
html.Hr(),
], width={'size': 8, 'offset': 0, 'order': 1}), # width first column on second row
dbc.Col([ # second column on second row
html.H5('Portfolio', className='text-center'),
dcc.Graph(id='indicators-ptf',
figure=indicators_ptf,
style={'height':550}),
html.Hr()
], width={'size': 2, 'offset': 0, 'order': 2}), # width second column on second row
dbc.Col([ # third column on second row
html.H5('S&P500', className='text-center'),
dcc.Graph(id='indicators-sp',
figure=indicators_sp500,
style={'height':550}),
html.Hr()
], width={'size': 2, 'offset': 0, 'order': 3}), # width third column on second row
]), # end of second row
dbc.Row([ # start of third row
dbc.Col([ # first column on third row
html.H5('Monthly Return (%)', className='text-center'),
dcc.Graph(id='chrt-portfolio-secondary',
figure=fig_growth2,
style={'height':380}),
], width={'size': 8, 'offset': 0, 'order': 1}), # width first column on second row
dbc.Col([ # second column on third row
html.H5('Top 15 Holdings', className='text-center'),
dcc.Graph(id='pie-top15',
figure = donut_top,
style={'height':380}),
], width={'size': 4, 'offset': 0, 'order': 2}), # width second column on second row
]) # end of third row
], fluid=True)
if __name__ == "__main__":
app.run_server(debug=True, port=8058)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment