Keep the X axis ticks when logscale is set globally. #136

Merged
merged 1 commit into from Mar 4, 2012

Projects

None yet

3 participants

@klausw
Contributor
klausw commented Mar 1, 2012

Currently, setting {logscale: true} at the toplevel options with a
numeric X axis attempts to use logarithmic ticks for the X axis too,
with strange results since the X values aren't scaled logarithmically.
This resulted in tests/logscale.html skipping the "6" and "8" numbers on
the ticker, and the modified demo with a large X value shows the effect
more clearly.

This change wraps the numericTicks generator as numericLinearTicks,
ignoring 'logscale' in its axis options, and uses that for the X axis
numeric ticker. Arguably doing it the other way around would be clearer,
but that would be a much larger refactoring.

(Note that date-valued X axes as used in the stock demo weren't affected
by this issue.)

@klausw klausw Keep the X axis ticks when logscale is set globally.
Currently, setting {logscale: true} at the toplevel options with a
numeric X axis attempts to use logarithmic ticks for the X axis too,
with strange results since the X values aren't scaled logarithmically.
This resulted in tests/logscale.html skipping the "6" and "8" numbers on
the ticker, and the modified demo with a large X value shows the effect
more clearly.

This change wraps the numericTicks generator as numericLinearTicks,
ignoring 'logscale' in its axis options, and uses that for the X axis
numeric ticker. Arguably doing it the other way around would be clearer,
but that would be a much larger refactoring.

(Note that date-valued X axes as used in the stock demo weren't affected
by this issue.)
44462ba
@kberg
Collaborator
kberg commented Mar 2, 2012

Since when has the x-axis been in log scale? That's not right. Can you show me somewhere in tests/ or gallery/ where this is happening?

@klausw
Contributor
klausw commented Mar 2, 2012

See http://dygraphs.com/tests/logscale.html - the digits 6 and 8 are
missing from the X scale due to generating tickers for log scale. I added
an extra point to that test at x=101 to show it more clearly.

On Fri, Mar 2, 2012 at 7:33 AM, Robert Konigsberg <
reply@reply.github.com

wrote:

Since when has the x-axis been in log scale? That's not right. Can you
show me somewhere in tests/ or gallery/ where this is happening?


Reply to this email directly or view it on GitHub:
#136 (comment)

@kberg
Collaborator
kberg commented Mar 2, 2012

Aha, it's not the values.

@danvk danvk merged commit 1f882d0 into danvk:master Mar 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment