【发布时间】:2022-01-11 12:42:58
【问题描述】:
如果满足条件,我需要显示一条消息。我看到 this post 处理显示空白图表但无法弄清楚如何申请我的需求。
图表的功能:
import plotly.express as px
@app.callback(
Output("graph-figure", "figure"),
Input("dropdown_a", "value"),
Input("dropdown_x", "value"),
Input("dropdown_y", "value"))
def update_graph(a, x_axis, y_axis):
df = pd.read_csv(r"C:\Users\user\project\Data.csv")
# in this case a message needs to be shown instead of the graph
if x_axis == y_axis:
# ...
return px.bar(df, x=x_axis, y=y_axis)
图形对象:
html.Div(dcc.Graph(id="graph-figure"))
如果您认为需要更多信息,请告诉我,我会提供。
谢谢。
【问题讨论】:
标签: python plotly-python