// we will prefer the unminified build which is easier to browse and works
// better with source mapping. In other cases, pick the minified build to
// make sure that the minification process (terser) doesn't break anything.
- const regex = args.watch ? /Chart\.js$/ : /Chart\.min\.js$/;
+ const regex = args.watch ? /chart\.js$/ : /chart\.min\.js$/;
const build = builds.filter(v => v.output.file.match(regex))[0];
if (args.watch) {
me._majorUnit = !tickOpts.major.enabled || me._unit === 'year' ? undefined
: determineMajorUnit(me._unit);
me._table = buildLookupTable(getTimestampsForTable(me), min, max, distribution);
- me._offsets = computeOffsets(me._table, getDataTimestamps(me), min, max, options);
+ me._offsets = computeOffsets(me._table, timestamps, min, max, options);
if (options.reverse) {
ticks.reverse();
--- /dev/null
+var date = moment('May 24 2020', 'MMM DD YYYY');
+
+module.exports = {
+ threshold: 0.05,
+ config: {
+ type: 'bar',
+ data: {
+ datasets: [{
+ backgroundColor: 'rgba(255, 0, 0, 0.5)',
+ data: [
+ {
+ x: date.clone().add(-2, 'day'),
+ y: 20,
+ },
+ {
+ x: date.clone().add(-1, 'day'),
+ y: 30,
+ },
+ {
+ x: date,
+ y: 40,
+ },
+ {
+ x: date.clone().add(1, 'day'),
+ y: 50,
+ },
+ {
+ x: date.clone().add(7, 'day'),
+ y: 10,
+ }
+ ]
+ }]
+ },
+ options: {
+ legend: false,
+ scales: {
+ x: {
+ display: false,
+ type: 'time',
+ distribution: 'linear',
+ ticks: {
+ source: 'auto'
+ },
+ time: {
+ unit: 'day'
+ }
+ },
+ y: {
+ display: false
+ }
+ }
+ }
+ },
+ options: {
+ spriteText: true
+ }
+};