散景是否在同一地块上重复值?

时间:2019-10-30 17:06:27

标签: python bokeh

我有一个散景图,每次像这样在图上运行像元时,值都会重复:

enter image description here

这是代码块,使用来自oracle数据库连接的数据

{"_id":{"$oid":"5db9b643b50c0d1540b8db89"},"id_user":"304780391","id_flight":"CPA-001","origin":"Costa Rica","destination":"Panamá","date_departure":{"$date":{"$numberLong":"1546300800000"}},"date_arrival":{"$date":{"$numberLong":"1559779200000"}},"tickets":{"$numberInt":"4"},"suitcases":{"$numberInt":"1"},"status":"Bought","seat":{"$numberInt":"-1"},"createdAt":{"$date":{"$numberLong":"1572451907375"}},"updatedAt":{"$date":{"$numberLong":"1572451907375"}},"__v":{"$numberInt":"0"}}

我的解决方案是

from bokeh.models import DaysTicker, FuncTickFormatter,SingleIntervalTicker, FixedTicker
source = ColumnDataSource(df_ora)
x = df_ora['DAY']
y = df_ora["ORANGES"]


labels = LabelSet(x='DAY', y= 'ORANGES', text='oranges', level='glyph',
           x_offset=5, y_offset=25, source=source, render_mode='canvas')


p2 = figure(title="",x_axis_type="datetime",y_range=(0,8000), plot_width=1500, plot_height=1000)
p2.line('DAY', 'ORANGES', source=source,line_width=2)
p2.add_layout(Title(text="Date", align="center"), "below")
p2.xaxis.ticker=DaysTicker(days=np.arange(0,32))

p2.add_layout(labels)
p2.circle(x=x, y=y,size=5)

但是,那仍然没有用。除此线图外,所有其他图形均正常更新。

0 个答案:

没有答案