Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import plotly.graph_objects as go
- import random as r
- fig = go.Figure(go.Indicator(
- mode = "number+gauge+delta",
- value = 0,
- domain = {'x': [0.1, 1], 'y': [0, 1]},
- title = {'text' :"<b>Level</b>"},
- delta = {'reference': 200},
- gauge = {
- 'shape': "bullet",
- 'axis': {'range': [None, 200]},
- # 'threshold': {
- # 'line': {'color': "red", 'width': 2},
- # 'thickness': 0.75,
- # 'value': 180},
- 'steps': [
- {'range': [0, 20], 'color': "red"},
- {'range': [20, 200], 'color': "green"}],
- 'bar': {'color': "darkgrey"}}))
- fig.update_layout(height = 250)
- fig.show()
- import time
- while True:
- p_input = r.randint(5, 200)
- time.sleep(10)
- print(p_input)
- fig.update_layout(......
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement