import dash
import dash_daq as daq
import dash_core_components as dcc
import dash_html_components as html
external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]
app = dash.Dash(name, external_stylesheets=external_stylesheets)
app.layout = html.Div([
daq.Gauge(
id=‘my-gauge’,
label=“Default”,
min = 0,
max = 100
value=0
),
])
@app.callback(
dash.dependencies.Output(‘my-gauge’, ‘value’),
[dash.dependencies.Input(‘my-gauge-slider’, ‘value’)]
)
def update_output(value):
return random.randint(0,100)
if name == ‘main’:
app.run_server(debug=True)
NOW HOW DO I ADD THIS CHART FROM PLOTLY INTO THIS GUI ??!!
import plotly.graph_objects as go
fig = go.Figure(go.Indicator(
mode = “number+gauge+delta”,
gauge = {‘shape’: “bullet”},
value = 220,
delta = {‘reference’: 300},
domain = {‘x’: [0, 1], ‘y’: [0, 1]},
title = {‘text’: “Profit”}))
fig.update_layout(height = 250)
fig.show()