☰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

Dynamically changing the bounds of an axes using sliders

Community Support
Brian_Myers
Brian_Myers

Hi everyone. I’m relatively new to Bokeh. Love it so far. At the moment, I’m using it to create simple stock price charts from Yahoo Finance data. The functionality I would like to add is to use widgets somehow (specifically I’m thinking of the slider) to dynamically change the x_range of my plots. More concretely, I’d like to select say ‘5’ on the slider and have the chart show 5 years of historical data and then select ‘3’ on the slider and have the chart update to only show 3 years of historical data. Is this possible? Thanks!

⌁   Link to post
Brian_Myers
Brian_Myers

Alternatively, another potential solution would be for me to use the xwheel_zoom tool if I could set it so that the upper bound of the x-axis stayed fixed (e.g. was always the last date) while the lower bound of the x-axis changed dynamically. Is this possible?

···

On Thursday, November 12, 2015 at 3:23:50 PM UTC-6, Brian Myers wrote:

Hi everyone. I’m relatively new to Bokeh. Love it so far. At the moment, I’m using it to create simple stock price charts from Yahoo Finance data. The functionality I would like to add is to use widgets somehow (specifically I’m thinking of the slider) to dynamically change the x_range of my plots. More concretely, I’d like to select say ‘5’ on the slider and have the chart show 5 years of historical data and then select ‘3’ on the slider and have the chart update to only show 3 years of historical data. Is this possible? Thanks!

⌁   Link to post
Sarah_Bird3
Sarah_Bird3

Seems like a CustomJS callback would do that for you.
See this page of the User Guide:

···

http://bokeh.pydata.org/en/latest/docs/user_guide/interaction.html
On 11/12/15 1:23 PM, Brian Myers wrote:

    Hi everyone.  I'm relatively new to Bokeh.  Love it

so far. At the moment, I’m using it to create simple stock
price charts from Yahoo Finance data. The functionality I would
like to add is to use widgets somehow (specifically I’m thinking
of the slider) to dynamically change the x_range of my plots.
More concretely, I’d like to select say ‘5’ on the slider and
have the chart show 5 years of historical data and then select
‘3’ on the slider and have the chart update to only show 3 years
of historical data. Is this possible? Thanks!

–

  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/2df5ea69-78f8-4019-bb78-064076042837%40continuum.io?utm_medium=email&utm_source=footer)      .

For more options, visit .

https://groups.google.com/a/continuum.io/d/msgid/bokeh/2df5ea69-78f8-4019-bb78-064076042837%40continuum.io
https://groups.google.com/a/continuum.io/d/optout

⌁   Link to post

End of archived discussion · Replies are disabled