d3.timeInterval()

d3.timeInterval(floor, offset[, count[, field]])

Constructs a new custom interval given the specified floor and offset functions and an optional count function.

The floor function takes a single date as an argument and rounds it down to the nearest interval boundary.

The offset function takes a date and an integer step as arguments and advances the specified date by the specified number of boundaries; the step may be positive, negative or zero.

The optional count function takes a start date and an end date, already floored to the current interval, and returns the number of boundaries between the start (exclusive) and end (inclusive). If a count function is not specified, the returned interval does not expose count or every methods. Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals.

The optional field function takes a date, already floored to the current interval, and returns the field value of the specified date, corresponding to the number of boundaries between this date (exclusive) and the latest previous parent boundary. For example, for the timeDay interval, this returns the number of days since the start of the month. If a field function is not specified, it defaults to counting the number of interval boundaries since the UNIX epoch of January 1, 1970 UTC. The field function defines the behavior of interval.every.

doc_D3_Js
2016-11-24 10:27:25
Comments
Leave a Comment

Please login to continue.