-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Rescale y-axis for graphs with x-axis rangeslider (Python) #6958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi there, As mentioned in the R issue- the range slider functionality is handled in our core graphing library: plotly.js so changes to this feature could be discussed there. Alternatively, you may be interested in implementing Dash, this is a python tool similar to Shiny for R (mentioned in R issue that you noted above). Specifically you could take a look at the interactive graphing section to see how you can implement events based on zooming on the graph. Don't forget you can always post questions and get feedback about individual projects that you're working on in our community forum: https://community.plot.ly which is free and open to all users! |
I struggled with getting this to work so I developed a code example to share. Example provides automatic updates to the yaxis range when and x range slider is updated. Y axis is set to show only price range of bars that are in the chart with a two tick padding. This worked well for me and I can potentially add any number of trace overlays that I want on top of the chart. Plus, I can run it locally without having to use plotly services. See gitub repo here: https://github.com/gersteing/DashCandlestickCharting/blob/master/README.md For whom ever wants to try it out. Runs locally using Flask. Enjoy |
I've ran into this same issue using the plotly js library. I created a simple workaround using the relayout event. Its specific to the ohlc chart type, but can easily modify to work with the other chart types. Hope it helps someone. |
Any update on this request? |
please update this |
I'd also like to have this feature in the main plotly.js. Atm I also use nearly the same workaround as @jamescoverdale to implement this by myself. |
I got some issue similar to this one when create candlestick chart using plotly. just add below code for removing rangeslider in the 'layout' |
Just to add some more information, I noticed that there was a community discussion (https://community.plotly.com/t/y-axis-autoscaling-with-x-range-sliders/10245) regarding to this and the proposed method (an 'xaxis.range' event registered in layout) seemed outdated. This would be very appealing in some use cases |
Setting yaxis fixedrange to false will allow to zooming while having a range slider. It's not autoscaling but it's easy and much better over having no zoom at all. Hope this helps someone. Credits: https://stackoverflow.com/a/52816021/10689649
|
Single line: |
Is there still no way to do this with rangeselector/slider and HTML plots? I do not want to use Dash. |
I am also looking for an easier solution 🙏 |
Still no solu? |
Re-opening as this is a valid feature request, but it was in the wrong place! Something we might consider for |
Related with the closed issue #912, I haven't found the functionality on Python Plotly library.
I haven't been able neither to implement something similar as they did in R in the aforementioned issue. I would like to keep everything in Python since I do other parts of analysis and it is intended to be modified by other users. I would appreciate any hit about how to do it.
The text was updated successfully, but these errors were encountered: