动态更新绘图仪图表值(Python)
我需要在python中更新plotly gauge chart的值。以下是我的源代码:动态更新绘图仪图表值(Python),python,charts,plotly,gauge,Python,Charts,Plotly,Gauge,我需要在python中更新plotly gauge chart的值。以下是我的源代码: import plotly.graph_objects as go fig = go.Figure(go.Indicator( domain={'x': [0, 1], 'y': [0, 1]}, value=450, mode="gauge+number+delta", title={'text': "Speed"}, del
import plotly.graph_objects as go
fig = go.Figure(go.Indicator(
domain={'x': [0, 1], 'y': [0, 1]},
value=450,
mode="gauge+number+delta",
title={'text': "Speed"},
delta={'reference': 380},
gauge={'axis': {'range': [None, 500]},
'steps': [
{'range': [0, 250], 'color': "lightgray"},
{'range': [250, 400], 'color': "gray"}],
'threshold': {'line': {'color': "red", 'width': 4}, 'thickness': 0.75, 'value': 490}}))
fig.show()
如果值发生变化,如何访问值并每次更改和显示
Hi@Niloloza,值存储在哪里?在我看来,在这种情况下应该使用hi@rpanai,因为您看到的初始值是450。我认为必须有一种方法来访问此值并对其进行更改。在这种情况下我使用破折号。