Function add

  • Arbitrary add one value to another.

    If the value l is of type Date, adds r units to it. t becomes the unit. For example add(dt, 3, 'week') will add 3 (r = 3) weeks (t= 'week') to dt.

    If l is of type numeric, t is ignored. In this case if r is of type string, it is assumed to be percentage (whether or not it includes %). For example add(30, 10) will give 40 and add(30, '10') will give 33.

    They also generate strange results if l is a string.

    Method

    add

    Memberof

    utils

    Parameters

    • l: any

      the value to modify

    • r: any

      the amount by which to modify the value

    • Optional t: any

      if l is a Date, then this should be a d3 time interval. For backward compatibility with dc.js 2.0, it can also be the name of an interval, i.e. 'millis', 'second', 'minute', 'hour', 'day', 'week', 'month', or 'year'

    Returns any

Generated using TypeDoc