Skip to content
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

Scale Y-Axis in TS Plots Dynamically #6

Closed
rywhale opened this issue Feb 20, 2018 · 8 comments
Closed

Scale Y-Axis in TS Plots Dynamically #6

rywhale opened this issue Feb 20, 2018 · 8 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@rywhale
Copy link

rywhale commented Feb 20, 2018

The Y-Axis on the time series plots should scale dynamically to the min/max of the values when you change the time period.

Currently we go from

pre_scale

to

post_scale

The scale needs to change in the second plot or the data isn't readable.

@Julien-Cousineau
Copy link
Owner

I'm not too sure I understand. Would the second plot Y-axis be between 2.46 and 2.5?

@rywhale
Copy link
Author

rywhale commented Feb 21, 2018

Yeah, the Y-axis in the second plot should scale to the min/max of the data in the second plot. In other words, every time you change the time range with one of the selectors (all, 6m, 1m, 1w), the Y-axis should automatically scale to the min/max values in the time range.

So if the min/max in the second plot are 2.46/2.5 you would scale to those values. The issue is that the second plot looks flat when in reality there is still some fluctuation going on there

@Julien-Cousineau
Copy link
Owner

I'll look into it. The Plotly library is nice but customization can be a pain.

@Julien-Cousineau Julien-Cousineau added the enhancement New feature or request label Mar 12, 2018
@beatonan
Copy link

@Julien-Cousineau we see the scaling of y-axis is a pretty high priority vs other issues so would be great if this could get some focus.

@Julien-Cousineau Julien-Cousineau added the bug Something isn't working label Mar 15, 2018
@Julien-Cousineau
Copy link
Owner

Julien-Cousineau commented Mar 15, 2018

From plotly:plotly/plotly.js#1876
The axis auto-range is currently not available.

Possible temporary solution:
Hard code y-axis based on selected data.

  1. Add clicking event = >(div.on('plotly_relayout',function(relayoutData){})) ✔️
  2. filter data based on dates = >relayoutData={xaxis.range[0]:start,xaxis.range[1]:end} ✔️
  3. find min max ✔️
  4. adjust graph ✔️

@Julien-Cousineau
Copy link
Owner

Julien-Cousineau commented Mar 15, 2018

My temporary code seems to be working. However the range slider at the bottom use the same y-axis as the chart as shown below. Please let me know if that is an issue.
screenshot 2018-03-15 at 19 14 48

@rywhale
Copy link
Author

rywhale commented Mar 16, 2018

@Julien-Cousineau Looks good to me

@Cevior
Copy link

Cevior commented Dec 26, 2022

Could you provide some (coding-) details on how you solved it? Would it be possible to integrate it via event handlers in R?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants