☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

How can I stack TimeSeries and fix the colors of items?

Community Support
exhuma
exhuma

Hi,

I’ve started playing around with bokeh in a Jupyter notebook recently. I’ve come across the TimeSeries graph which is exactly what I need.

In one data source, I have values which monitor quality of network interfaces. The data source gives me 3 counts:

  • Number of interfaces in “normal” state

  • Number of interfaces in “warning” state

  • Number of interfaces in “critical” state

Example (as CSV):

timestamp;normal;warning;critical

2016-11-01;10;5;0

2016-11-02;9;6;0

2016-11-03;9;5;1

2016-11-04;10;5;0

2016-11-05;11;5;0

2016-11-06;5;5;6

I have a couple of questions:

  1. Is it possible to stack these values in a TimeSeries graph? If yes, how do I do that?

  2. Is it possible to “freeze” the colours as normal=green, wearning=yellow, critical=red?

Cheers,

Mich.

⌁   Link to post
Bryan
Bryan

Hi Mich,

For now you will probably just want to use the "line" glyph method from bokeh.plotting in order to have more control over appearance, etc. There's some example of using bokeh.plotting on timeseries data here, e.g.

  http://bokeh.pydata.org/en/latest/docs/gallery/stocks.htm

There's nothing built into bokeh currently that will stack anything, except for the Area chart which does have some automatic features around this. So, if you want to have lines representing stacked series, you'll need to compute the stacked series yourself. Here is an example that does that:
  
  http://bokeh.pydata.org/en/latest/docs/gallery/brewer.html

The little function there assumes the series you want to stack line up on the time axis, if they don't you'd have to do some kind of interpolation to stack them.

Thanks,

Bryan

···

On Nov 25, 2016, at 1:37 AM, exhuma@gmail.com wrote:

Hi,

I've started playing around with bokeh in a Jupyter notebook recently. I've come across the TimeSeries graph which is exactly what I need.

In one data source, I have values which monitor quality of network interfaces. The data source gives me 3 counts:

* Number of interfaces in "normal" state
* Number of interfaces in "warning" state
* Number of interfaces in "critical" state

Example (as CSV):

timestamp;normal;warning;critical
2016-11-01;10;5;0
2016-11-02;9;6;0
2016-11-03;9;5;1
2016-11-04;10;5;0
2016-11-05;11;5;0
2016-11-06;5;5;6

I have a couple of questions:

1) Is it possible to stack these values in a TimeSeries graph? If yes, how do I do that?
2) Is it possible to "freeze" the colours as normal=green, wearning=yellow, critical=red?

Cheers,

Mich.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c6dbdf12-a521-4710-b270-200a1ebf09a5%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post

End of archived discussion · Replies are disabled