散景多线图未显示

时间:2018-02-01 03:25:56

标签: python pandas bokeh

我有一个如下的数据框

    data_date  created_time  order_number
0  2017-02-01         00:00           204
1  2017-02-01         10:00            85
2  2017-02-02         20:00            73
3  2017-02-02         13:00            79
4  2017-02-03         14:00           166

所以我想做的是每天按小时显示预订金额。线图将根据data_date列而有所不同,因此图表上应该有3行。

这是我用散景库

制作的代码
source = ColumnDataSource(hourly_booking)
colormap = CategoricalColorMapper(factors=hourly_booking['data_date'].unique(), palette=['red', 'green', 'blue'])
p = figure(x_axis_label = 'Time (24-Hour)', y_axis_label = 'Amount of order')
p.multi_line(xs='created_booking', ys='order_number', source=source, line_color=dict(field='data_date', transform=colormap), line_width=5, line_alpha=0.6, legend='data_date')

output_file('graph.html')
show(p)

然而页面变成空白,所以我不知道代码出了什么问题。

enter image description here

我该怎么办? 任何建议将不胜感激:)

0 个答案:

没有答案