情节表达如何取消选择和隐藏Y轴上的时间表(作业)?
我需要选项来取消选择Y轴上的多个时间轴(作业),以使它们被隐藏。例如,以下示例代码。
import plotly.express as px
import pandas as pd
df = pd.DataFrame([
dict(Task="Job A", Start='2009-01-01', Finish='2009-02-28'),
dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15'),
dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30')
])
fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task")
fig.update_yaxes(autorange="reversed") # otherwise tasks are listed from the bottom up
fig.show()
我需要选择取消选择一个或多个Y轴作业A/B/C,以便隐藏它们?
我发现以下类似问题。但是它将Y轴分为类别,而不是可选的选项。 y-axis不符合时间表的数量
I need the option to deselect multiple timeline (jobs) on y-axis so that they are hidden. For example following sample code.
import plotly.express as px
import pandas as pd
df = pd.DataFrame([
dict(Task="Job A", Start='2009-01-01', Finish='2009-02-28'),
dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15'),
dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30')
])
fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task")
fig.update_yaxes(autorange="reversed") # otherwise tasks are listed from the bottom up
fig.show()
I need to option to deselect one or more y-axis Job A/B/C so that they are hidden?
I Found following similar question. But it divides y-axis into categories, instead of selectable options.
Y-axis doesn't fit the number of timelines
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论