I’m trying to create a dash in my company internal network (Because of security issues, we cannot connect to Internet). Below is my code:
import pandas as pd
import numpy as np
from pandas import ExcelWriter
import plotly.graph_objects as go
import plotly.express as px
df1 = pd.DataFrame({
'BAS_DT': ['20210104','20210105','20210106','20210107','20210108'],
'LIM': [22071,20775,20841,21891,22395],
'APPR_LIM':[22000,22000,22000,22000,22000]})
df1.head()
#df1:
BAS_DT LIM APPR_LIM
0 20210104 22071 22000
1 20210105 20775 22000
2 20210106 20841 22000
3 20210107 21891 22000
4 20210108 22395 22000
fig = go.Figure()
fig.add_trace(go.Scatter(
x=frame_pivot['BAS_DT'],
y=frame_pivot['CLOC_CUR_XC_BL'],
name = "Credit Amount of Woori Bank Vietnam",
mode='lines+markers+text',
text = frame_pivot['CLOC_CUR_XC_BL'],
textposition='top center',
line_shape='spline'))
fig.add_trace(go.Scatter(
x=frame_pivot['BAS_DT'],
y=frame_pivot['Limit'],
name = "SBV Approved Limit",
mode='lines',
line_shape='spline',
line=dict(dash='dash')))
fig.update_traces(texttemplate='%{text:,}')
fig.update_layout(title={'text':"Credit Growth",'x':0.5,'xanchor':'center'},plot_bgcolor='rgba(0,0,0,0)')
fig.update_xaxes(showline=False,showgrid=False,tickangle=90)
fig.update_yaxes(showline=False,showgrid=False)
fig_2 = go.Figure(data=[go.Table(
columnwidth=[15,15,15],
header=dict(values=list(frame_pivot.columns),
fill_color='paleturquoise',
align='center'),
cells=dict(values=[frame_pivot['BAS_DT'],frame_pivot['CLOC_CUR_XC_BL'],frame_pivot['Limit']],
fill_color='lavender',
align='center',
format=[None,",.2f",",.2f"]))
])
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Output, Input
import dash_bootstrap_components as dbc
import dash_table
from jupyter_dash import JupyterDash
app = dash.Dash(__name__,external_stylesheets=[dbc.themes.DARKLY])
app.layout = dbc.Container([html.H1("Credit Growth",className="bg-primary text-white text-center"),
dbc.Row(
[
dbc.Col(dcc.Graph(figure=fig),lg=8),
dbc.Col(dcc.Graph(figure=fig_2),lg=4)
]),],fluid=True)
if __name__ == "__main__":
app.run_server(debug=False, port=8050)
It’s worked on my laptop with Internet connection, but in my company’s PC dash shows without layout:
Laptop
PC
I would like to ask is there anyway to fix it. Thanks and best regards.