I prepared two ColumnDataSource which has different data set for y axis.
plot.line('x', 'y', source=source, line_width=2)
plot.circle('x', 'y', source=source, fill_color="blue", size=8)
plot.vbar(x='x', top='y', source=source1, width=0.5, bottom=0, fill_color="red")#this part doesn't work.
And line and circle does work but when I tried to show the vbar for another data, it doesn't show but seems like the range of the axis is changed by the vbar codes.
I tried to show only the vbar graph on mini program. And vber is never shown for my dataframe.
And I found out there's a problem with my datetime object. The line graph can be shown for datetime object's xaxis. But I changed the code for showing vbar, it doesn't show anything. And when I changed the xaxis to just the number, like x=[1, 2, 3...] while top keeps the same, the vbar is shown.
Vbar cannot be used for datetime? Or is there another reason? I'm sure the datetime xaxis is the problem.
Datetime axes are ultimately denominated in units of "milliseconds since epoch". For vbars to show up on a datetime axis, you will usually have to make the width much larger (0.5 means 0.5 milliseconds which is just going to be invisible at most typical scales)
来源:https://stackoverflow.com/questions/49203672/bokeh-vbar-cannot-be-shown-for-datetime-xaxis