-
Notifications
You must be signed in to change notification settings - Fork 605
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
Using valueRange with Logscale and yRangePad has unexpected results #661
Comments
I think there's at least two issues here: https://github.com/danvk/dygraphs/blob/master/src/dygraph.js#L2638
First problem is that "axis.logscale" is always false, the axis object doesn't have this property. So the conditional is always false in yRangePad + logscale + valueRange mode, and it inappropriately takes the branch below for a linear scale. Next problem is that it adjusts in the wrong direction - should be:
If I make these changes in an interactive session, it looks much more reasonable, though the padding amount isn't quite right - I seem to get just ~3 pixels of padding after requesting 10 pixels. |
Here's an updated jsfiddle - the original one didn't work for me: http://jsfiddle.net/hg0nfytr/5/ The default yrange = 0.25005,3 shows the issue, the y axis starts at 1.00e-4. Setting ymin to <= 0.25 breaks the graph entirely. |
Just an fyi I updated the original fiddle to work: http://jsfiddle.net/85f1ga5e/ |
Also includes a minor refactor to consolidate duplicated code for toDataCoord calculations on logscale axes. Fixes issue danvk#661.
Proposed fix + regression tests in #732 . The padding is now pixel-accurate in logscale. |
Fix is merged in master. Looks like I can't close the bug though. |
Also includes a minor refactor to consolidate duplicated code for toDataCoord calculations on logscale axes. Fixes issue danvk#661.
Also includes a minor refactor to consolidate duplicated code for toDataCoord calculations on logscale axes. Fixes issue danvk#661.
Please refer to this article: http://stackoverflow.com/questions/32609202/dygraphs-using-valuerange-with-logscale
The text was updated successfully, but these errors were encountered: