Timeseries data as a step chart

Hello,

Thank you for this library I am liking the possibilities. I have dabbled a little bit with Bokeh’s past releases but with 0.8.0 I decided to look a bit deeper.

I have reached an issue where I am trying to show timeseries data as a step chart. I can make a TimeSeries chart fine BUT Step chart doesn’t work (I am not sure what the xscale is doing).

Any suggestions?

import datetime
from collections import OrderedDict
from bokeh.charts import Line, Step, TimeSeries
from bokeh.plotting import show

now = datetime.datetime.now()
dt = [now+datetime.timedelta(seconds=i) for i in range(10)]
xyvalues = OrderedDict({‘date’: dt})
xyvalues[‘data’] = [2, 3, 7, 5, 26, 27, 27, 28, 26, 20]
xyvalues[‘moredata’] = [12, 33, 47, 15, 126, 122, 95, 90, 110, 112]

#ln = Line(xyvalues, index=‘date’, xscale=‘datetime’)
#st = Step(xyvalues, index=‘date’, xscale=‘datetime’)
ts = TimeSeries(xyvalues, index=‘date’)
show(ts)

Hi,

Thanks for you interest in Bokeh!

At the moment I can’t think of a quick workaround for this to work with 0.8 without changing the charts implementation (even if it’s a very small change)… that said I think we should consider it a bug and [maybe] can be considered a bug. I’m opening an issue (https://github.com/bokeh/bokeh/issues/1935) to address this.

Thank you

Fabio

···

On Thursday, February 19, 2015 at 1:58:05 AM UTC+1, BevanJ wrote:

Hello,

Thank you for this library I am liking the possibilities. I have dabbled a little bit with Bokeh’s past releases but with 0.8.0 I decided to look a bit deeper.

I have reached an issue where I am trying to show timeseries data as a step chart. I can make a TimeSeries chart fine BUT Step chart doesn’t work (I am not sure what the xscale is doing).

Any suggestions?

import datetime
from collections import OrderedDict
from bokeh.charts import Line, Step, TimeSeries
from bokeh.plotting import show

now = datetime.datetime.now()
dt = [now+datetime.timedelta(seconds=i) for i in range(10)]
xyvalues = OrderedDict({‘date’: dt})
xyvalues[‘data’] = [2, 3, 7, 5, 26, 27, 27, 28, 26, 20]
xyvalues[‘moredata’] = [12, 33, 47, 15, 126, 122, 95, 90, 110, 112]

#ln = Line(xyvalues, index=‘date’, xscale=‘datetime’)
#st = Step(xyvalues, index=‘date’, xscale=‘datetime’)
ts = TimeSeries(xyvalues, index=‘date’)
show(ts)