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
Have to say this refactor is a dream. Nice work all around.
I'm working to get our version at KPCC updated and in some test data I'm not getting the years to display verbatim. By default dates are rendered every five years. I did add a four year frequency to the dateFrequencies object, but that ignores the minDate (1962) and the maxDate (2014).
Any hints on where I can begin to address and configure to only 1962, 1966, 1970, etc are displayed?
The text was updated successfully, but these errors were encountered:
chrislkeller
changed the title
Why wouldn't exact dates contained in the data be displayed
Exact dates contained in the data not being displayed
Jun 26, 2015
This is to do with how d3 handles date intervals. As you can see in the code for d3.time.interval.range, it works by converting your year to a number and running year % interval, adding to the final array whichever values resolve to zero. So in your case:
1962%4// 2 -- not added to array1964%4// 0 -- added to array
@nsonnad, @yanofsky: The knowledge and example code is much appreciated.
@yanofsky - Aside from the bug you point out your commit works like you mentioned, though we do lose a tick for the last year in the data - in this case 2014.
Using the RequireBin link I'll continue to learn more about how this works...
Have to say this refactor is a dream. Nice work all around.
I'm working to get our version at KPCC updated and in some test data I'm not getting the years to display verbatim. By default dates are rendered every five years. I did add a four year frequency to the
dateFrequencies
object, but that ignores the minDate (1962) and the maxDate (2014).Any hints on where I can begin to address and configure to only 1962, 1966, 1970, etc are displayed?
Data is:
Using Auto date frequency
Attempt at 4-year date frequency
The text was updated successfully, but these errors were encountered: