You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An axis that uses a date scale (d3.scaleTime) and has a specified number of ticks (.ticks(6)) is apparently mislabelled. All the ticks are labelled with the string "6".
These arguments are also passed to the scale’s tickFormat method to generate a tick format (unless a tick format is specified explicitly via axis.tickFormat)
Is there any way to specify the number of ticks while retaining the default tick format?
Yeah, I think this is a bug. The problem is that the time scale’s tickFormat method isn’t consistent with the other scales, which all take a suggested count as the first argument.
In D3 3.x this wasn’t an issue because the time scale ignored all arguments to scale.tickFormat. So, if you specified a count to axis.ticks, it would affect scale.ticks, but not scale.tickFormat (because a time scale always renders times the same way, dependent only on the input time and not the number of ticks).
An axis that uses a date scale (
d3.scaleTime
) and has a specified number of ticks (.ticks(6)
) is apparently mislabelled. All the ticks are labelled with the string"6"
.See demo here.
The text was updated successfully, but these errors were encountered: