Python 数据在plotly Range Slider中不可见

Python 数据在plotly Range Slider中不可见,python,visualization,plotly,gantt-chart,Python,Visualization,Plotly,Gantt Chart,我正在使用Plotly和Python以及pandas df创建一个带有范围滑块的甘特图。但是,RangeSloider上的数据不可见,它显示为白色,而不是实际绘图中的颜色 下面是我正在使用的部分代码: from plotly.offline import plot import plotly.figure_factory as ff colors = {0: 'rgb(46, 137, 205)', 1: 'rgb(58, 149, 136)',

我正在使用Plotly和Python以及pandas df创建一个带有范围滑块的甘特图。但是,RangeSloider上的数据不可见,它显示为白色,而不是实际绘图中的颜色

下面是我正在使用的部分代码:

from plotly.offline import plot
import plotly.figure_factory as ff

colors = {0: 'rgb(46, 137, 205)',
              1: 'rgb(58, 149, 136)',
              2: 'rgb(114, 44, 121)'}
fig = ff.create_gantt(df, colors=colors, index_col='num_faces', show_colorbar=True,
                          bar_width=0.2, showgrid_x=True, showgrid_y=True, group_tasks=True)

fig['layout']['xaxis']['rangeselector']['visible'] = False
fig['layout']['xaxis']['rangeslider'] = dict(bgcolor='#000')
fig['layout']['xaxis']['type'] = 'date'
# yaxis customisation
fig['layout']['yaxis']['title'] = 'Number of people'
# plot customisation
fig['layout']['title'] = 'Time Spent with People'
仅为了显示选项,我将
范围滑块的背景色设置为黑色,下面是打印结果。如您所见,数据在那里,但不带颜色

关于如何使我的数据在RangeSloider上可见,有什么解决方案吗

提前谢谢

我正在使用plotly v.2.2.1和Python 3.5.2