if (notnull(xmax)) {
        options.scales.xAxes[0][ticksKey].max = toDate(xmax).getTime();
      }