]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update tick positioning (#8657)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Wed, 17 Mar 2021 22:22:21 +0000 (00:22 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Mar 2021 22:22:21 +0000 (18:22 -0400)
* Update tick positioning
* Update tests

130 files changed:
src/core/core.scale.js
test/fixtures/controller.bar/minBarLength/horizontal-neg.png
test/fixtures/controller.bar/minBarLength/horizontal-pos.png
test/fixtures/controller.bar/minBarLength/horizontal.png
test/fixtures/controller.bar/not-grouped/on-time.png
test/fixtures/controller.bubble/clip.png
test/fixtures/controller.line/clip/default-x-max.png
test/fixtures/controller.line/clip/default-x-min.png
test/fixtures/controller.line/clip/default-x.png
test/fixtures/controller.line/clip/default-y-max.png
test/fixtures/controller.line/clip/default-y-min.png
test/fixtures/controller.line/clip/default-y.png
test/fixtures/controller.line/clip/specified.png
test/fixtures/core.layouts/hidden-vertical-boxes.png
test/fixtures/core.layouts/long-labels.png
test/fixtures/core.layouts/refit-vertical-boxes.png
test/fixtures/core.layouts/scriptable.png
test/fixtures/core.scale/autoSkip/fit-after.png
test/fixtures/core.scale/autoSkip/no-offset.png
test/fixtures/core.scale/autoSkip/offset.png
test/fixtures/core.scale/backgroundColor.png
test/fixtures/core.scale/cartesian-axis-border-settings.png
test/fixtures/core.scale/crossAlignment/cross-align-bottom-center.png
test/fixtures/core.scale/crossAlignment/cross-align-bottom-far.png
test/fixtures/core.scale/crossAlignment/cross-align-bottom-near.png
test/fixtures/core.scale/crossAlignment/cross-align-left-center.png
test/fixtures/core.scale/crossAlignment/cross-align-left-far-clipped.png
test/fixtures/core.scale/crossAlignment/cross-align-left-far.png
test/fixtures/core.scale/crossAlignment/cross-align-left-near.png
test/fixtures/core.scale/crossAlignment/cross-align-right-center.png
test/fixtures/core.scale/crossAlignment/cross-align-right-far.png
test/fixtures/core.scale/crossAlignment/cross-align-right-near.png
test/fixtures/core.scale/crossAlignment/cross-align-top-center.png
test/fixtures/core.scale/crossAlignment/cross-align-top-far.png
test/fixtures/core.scale/crossAlignment/cross-align-top-near.png
test/fixtures/core.scale/label-align-center.png
test/fixtures/core.scale/label-align-end.png
test/fixtures/core.scale/label-align-start.png
test/fixtures/core.scale/label-offset-vertical-axes.png
test/fixtures/core.scale/tick-drawing.png
test/fixtures/core.scale/tick-override-styles.png
test/fixtures/core.scale/ticks-mirror.png
test/fixtures/core.scale/ticks/rotated-long.js [new file with mode: 0644]
test/fixtures/core.scale/ticks/rotated-long.png [new file with mode: 0644]
test/fixtures/core.scale/ticks/rotated-multi-line.js [new file with mode: 0644]
test/fixtures/core.scale/ticks/rotated-multi-line.png [new file with mode: 0644]
test/fixtures/core.scale/title/align-end.png
test/fixtures/core.scale/title/align-start.png
test/fixtures/core.scale/title/multi-line/align-end.png
test/fixtures/core.scale/title/multi-line/align-start.png
test/fixtures/core.scale/x-axis-position-center.png
test/fixtures/core.scale/x-axis-position-dynamic.png
test/fixtures/core.scale/y-axis-position-center.png
test/fixtures/core.scale/y-axis-position-dynamic.png
test/fixtures/mixed/bar+line.png
test/fixtures/scale.category/ticks-from-data.png
test/fixtures/scale.linear/grace-neg.png
test/fixtures/scale.linear/grace-pos.png
test/fixtures/scale.linear/grace.png
test/fixtures/scale.linear/min-max-skip.png
test/fixtures/scale.linear/tick-count-data-limits.png
test/fixtures/scale.linear/tick-count-min-max-not-aligned.png
test/fixtures/scale.linear/tick-count-min-max.png
test/fixtures/scale.linear/tick-step-min-max.png
test/fixtures/scale.linear/tiny-numbers.png
test/fixtures/scale.time/autoskip-major.png
test/fixtures/scale.time/custom-parser.js
test/fixtures/scale.time/custom-parser.png
test/fixtures/scale.time/data-ty.js
test/fixtures/scale.time/data-ty.png
test/fixtures/scale.time/data-xy.js
test/fixtures/scale.time/data-xy.png
test/fixtures/scale.time/invalid-data.png
test/fixtures/scale.time/labels-date.js
test/fixtures/scale.time/labels-date.png
test/fixtures/scale.time/labels-strings.js
test/fixtures/scale.time/labels-strings.png
test/fixtures/scale.time/labels.js
test/fixtures/scale.time/labels.png
test/fixtures/scale.time/negative-times.png
test/fixtures/scale.time/offset-with-no-ticks.png
test/fixtures/scale.time/source-auto-linear.js
test/fixtures/scale.time/source-auto-linear.png
test/fixtures/scale.time/source-data-linear.js
test/fixtures/scale.time/source-data-linear.png
test/fixtures/scale.time/source-labels-linear-offset-min-max.js
test/fixtures/scale.time/source-labels-linear-offset-min-max.png
test/fixtures/scale.time/source-labels-linear.js
test/fixtures/scale.time/source-labels-linear.png
test/fixtures/scale.time/ticks-capacity.js
test/fixtures/scale.time/ticks-capacity.png
test/fixtures/scale.time/ticks-minunit.js
test/fixtures/scale.time/ticks-minunit.png
test/fixtures/scale.time/ticks-reverse-linear-min-max.js
test/fixtures/scale.time/ticks-reverse-linear-min-max.png
test/fixtures/scale.time/ticks-reverse-linear.png
test/fixtures/scale.time/ticks-reverse-offset.js
test/fixtures/scale.time/ticks-reverse-offset.png
test/fixtures/scale.time/ticks-reverse.js
test/fixtures/scale.time/ticks-reverse.png
test/fixtures/scale.time/ticks-round.png
test/fixtures/scale.time/ticks-stepsize.png
test/fixtures/scale.time/ticks-unit.js
test/fixtures/scale.time/ticks-unit.png
test/fixtures/scale.timeseries/financial-daily.js
test/fixtures/scale.timeseries/financial-daily.png
test/fixtures/scale.timeseries/normalize.js
test/fixtures/scale.timeseries/normalize.png
test/fixtures/scale.timeseries/source-auto.js
test/fixtures/scale.timeseries/source-auto.png
test/fixtures/scale.timeseries/source-data-offset-min-max.js
test/fixtures/scale.timeseries/source-data-offset-min-max.png
test/fixtures/scale.timeseries/source-data.js
test/fixtures/scale.timeseries/source-data.png
test/fixtures/scale.timeseries/source-labels-offset-min-max.js
test/fixtures/scale.timeseries/source-labels-offset-min-max.png
test/fixtures/scale.timeseries/source-labels.js
test/fixtures/scale.timeseries/source-labels.png
test/fixtures/scale.timeseries/ticks-reverse-max.png
test/fixtures/scale.timeseries/ticks-reverse-min-max.js
test/fixtures/scale.timeseries/ticks-reverse-min-max.png
test/fixtures/scale.timeseries/ticks-reverse-min.png
test/fixtures/scale.timeseries/ticks-reverse.js
test/fixtures/scale.timeseries/ticks-reverse.png
test/specs/core.controller.tests.js
test/specs/core.layouts.tests.js
test/specs/platform.basic.tests.js
test/specs/scale.category.tests.js
test/specs/scale.linear.tests.js
test/specs/scale.time.tests.js

index 2da29729094584c68ff2e927ea9a9c6c56121a71..d6da91d3ead98996ec24f4c079cf2732f15ce4aa 100644 (file)
@@ -43,7 +43,7 @@ defaults.set('scale', {
     drawBorder: true,
     drawOnChartArea: true,
     drawTicks: true,
-    tickLength: 10,
+    tickLength: 8,
     tickWidth: (_ctx, options) => options.lineWidth,
     tickColor: (_ctx, options) => options.color,
     offset: false,
@@ -75,7 +75,7 @@ defaults.set('scale', {
     mirror: false,
     textStrokeWidth: 0,
     textStrokeColor: '',
-    padding: 0,
+    padding: 3,
     display: true,
     autoSkip: true,
     autoSkipPadding: 3,
@@ -783,7 +783,7 @@ export default class Scale extends Element {
 
     const labelSizes = me._getLabelSizes();
     const maxLabelWidth = labelSizes.widest.width;
-    const maxLabelHeight = labelSizes.highest.height - labelSizes.highest.offset;
+    const maxLabelHeight = labelSizes.highest.height;
 
     // Estimate the width of each grid based on the canvas width, the maximum
     // label width and the number of tick intervals
@@ -822,104 +822,40 @@ export default class Scale extends Element {
       height: 0
     };
 
-    const chart = me.chart;
-    const opts = me.options;
-    const tickOpts = opts.ticks;
-    const titleOpts = opts.title;
-    const gridLineOpts = opts.grid;
+    const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = me;
     const display = me._isVisible();
-    const labelsBelowTicks = opts.position !== 'top' && me.axis === 'x';
     const isHorizontal = me.isHorizontal();
-    const titleHeight = display && getTitleHeight(titleOpts, chart.options.font);
-
-    // Width
-    if (isHorizontal) {
-      minSize.width = me.maxWidth;
-    } else if (display) {
-      minSize.width = getTickMarkLength(gridLineOpts) + titleHeight;
-    }
 
-    // height
-    if (!isHorizontal) {
-      minSize.height = me.maxHeight; // fill all the height
-    } else if (display) {
-      minSize.height = getTickMarkLength(gridLineOpts) + titleHeight;
-    }
+    if (display) {
+      const titleHeight = getTitleHeight(titleOpts, chart.options.font);
+      if (isHorizontal) {
+        minSize.width = me.maxWidth;
+        minSize.height = getTickMarkLength(gridOpts) + titleHeight;
+      } else {
+        minSize.height = me.maxHeight; // fill all the height
+        minSize.width = getTickMarkLength(gridOpts) + titleHeight;
+      }
 
-    // Don't bother fitting the ticks if we are not showing the labels
-    if (tickOpts.display && display && me.ticks.length) {
-      const labelSizes = me._getLabelSizes();
-      const firstLabelSize = labelSizes.first;
-      const lastLabelSize = labelSizes.last;
-      const widestLabelSize = labelSizes.widest;
-      const highestLabelSize = labelSizes.highest;
-      const lineSpace = highestLabelSize.offset * 0.8;
-      const tickPadding = tickOpts.padding;
+      // Don't bother fitting the ticks if we are not showing the labels
+      if (tickOpts.display && me.ticks.length) {
+        const {first, last, widest, highest} = me._getLabelSizes();
+        const tickPadding = tickOpts.padding * 2;
+        const angleRadians = toRadians(me.labelRotation);
+        const cos = Math.cos(angleRadians);
+        const sin = Math.sin(angleRadians);
 
-      if (isHorizontal) {
+        if (isHorizontal) {
         // A horizontal axis is more constrained by the height.
-        const isRotated = me.labelRotation !== 0;
-        const angleRadians = toRadians(me.labelRotation);
-        const cosRotation = Math.cos(angleRadians);
-        const sinRotation = Math.sin(angleRadians);
-
-        const labelHeight = sinRotation * widestLabelSize.width
-                                       + cosRotation * (highestLabelSize.height - (isRotated ? highestLabelSize.offset : 0))
-                                       + (isRotated ? 0 : lineSpace); // padding
-
-        minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight + tickPadding);
-
-        const offsetLeft = me.getPixelForTick(0) - me.left;
-        const offsetRight = me.right - me.getPixelForTick(me.ticks.length - 1);
-        let paddingLeft, paddingRight;
-
-        // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned
-        // which means that the right padding is dominated by the font height
-        if (isRotated) {
-          paddingLeft = labelsBelowTicks ?
-            cosRotation * firstLabelSize.width + sinRotation * firstLabelSize.offset :
-            sinRotation * (firstLabelSize.height - firstLabelSize.offset);
-          paddingRight = labelsBelowTicks ?
-            sinRotation * (lastLabelSize.height - lastLabelSize.offset) :
-            cosRotation * lastLabelSize.width + sinRotation * lastLabelSize.offset;
-        } else if (tickOpts.align === 'start') {
-          paddingLeft = 0;
-          paddingRight = lastLabelSize.width;
-        } else if (tickOpts.align === 'end') {
-          paddingLeft = firstLabelSize.width;
-          paddingRight = 0;
+          const labelHeight = sin * widest.width + cos * highest.height;
+          minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight + tickPadding);
         } else {
-          paddingLeft = firstLabelSize.width / 2;
-          paddingRight = lastLabelSize.width / 2;
-        }
-
-        // Adjust padding taking into account changes in offsets
-        // and add 3 px to move away from canvas edges
-        me.paddingLeft = Math.max((paddingLeft - offsetLeft) * me.width / (me.width - offsetLeft), 0) + 3;
-        me.paddingRight = Math.max((paddingRight - offsetRight) * me.width / (me.width - offsetRight), 0) + 3;
-      } else {
         // A vertical axis is more constrained by the width. Labels are the
         // dominant factor here, so get that length first and account for padding
-        const labelWidth = tickOpts.mirror ? 0 :
-        // use lineSpace for consistency with horizontal axis
-        // tickPadding is not implemented for horizontal
-          widestLabelSize.width + tickPadding + lineSpace;
-
-        minSize.width = Math.min(me.maxWidth, minSize.width + labelWidth);
-
-        let paddingTop = lastLabelSize.height / 2;
-        let paddingBottom = firstLabelSize.height / 2;
-
-        if (tickOpts.align === 'start') {
-          paddingTop = 0;
-          paddingBottom = firstLabelSize.height;
-        } else if (tickOpts.align === 'end') {
-          paddingTop = lastLabelSize.height;
-          paddingBottom = 0;
-        }
+          const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;
 
-        me.paddingTop = paddingTop;
-        me.paddingBottom = paddingBottom;
+          minSize.width = Math.min(me.maxWidth, minSize.width + labelWidth + tickPadding);
+        }
+        me._calculatePadding(first, last, sin, cos);
       }
     }
 
@@ -934,6 +870,57 @@ export default class Scale extends Element {
     }
   }
 
+  _calculatePadding(first, last, sin, cos) {
+    const me = this;
+    const {ticks: {align, padding}, position} = me.options;
+    const isRotated = me.labelRotation !== 0;
+    const labelsBelowTicks = position !== 'top' && me.axis === 'x';
+
+    if (me.isHorizontal()) {
+      const offsetLeft = me.getPixelForTick(0) - me.left;
+      const offsetRight = me.right - me.getPixelForTick(me.ticks.length - 1);
+      let paddingLeft = 0;
+      let paddingRight = 0;
+
+      // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned
+      // which means that the right padding is dominated by the font height
+      if (isRotated) {
+        if (labelsBelowTicks) {
+          paddingLeft = cos * first.width;
+          paddingRight = sin * last.height;
+        } else {
+          paddingLeft = sin * first.height;
+          paddingRight = cos * last.width;
+        }
+      } else if (align === 'start') {
+        paddingRight = last.width;
+      } else if (align === 'end') {
+        paddingLeft = first.width;
+      } else {
+        paddingLeft = first.width / 2;
+        paddingRight = last.width / 2;
+      }
+
+      // Adjust padding taking into account changes in offsets
+      me.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * me.width / (me.width - offsetLeft), 0);
+      me.paddingRight = Math.max((paddingRight - offsetRight + padding) * me.width / (me.width - offsetRight), 0);
+    } else {
+      let paddingTop = last.height / 2;
+      let paddingBottom = first.height / 2;
+
+      if (align === 'start') {
+        paddingTop = 0;
+        paddingBottom = first.height;
+      } else if (align === 'end') {
+        paddingTop = last.height;
+        paddingBottom = 0;
+      }
+
+      me.paddingTop = paddingTop + padding;
+      me.paddingBottom = paddingBottom + padding;
+    }
+  }
+
   /**
         * Handle margins and padding interactions
         * @private
@@ -990,7 +977,13 @@ export default class Scale extends Element {
     let labelSizes = me._labelSizes;
 
     if (!labelSizes) {
-      me._labelSizes = labelSizes = me._computeLabelSizes();
+      const sampleSize = me.options.ticks.sampleSize;
+      let ticks = me.ticks;
+      if (sampleSize < ticks.length) {
+        ticks = sample(ticks, sampleSize);
+      }
+
+      me._labelSizes = labelSizes = me._computeLabelSizes(ticks, ticks.length);
     }
 
     return labelSizes;
@@ -1002,26 +995,17 @@ export default class Scale extends Element {
         * @return {{ first: object, last: object, widest: object, highest: object }}
         * @private
         */
-  _computeLabelSizes() {
-    const me = this;
-    const ctx = me.ctx;
-    const caches = me._longestTextCache;
-    const sampleSize = me.options.ticks.sampleSize;
+  _computeLabelSizes(ticks, length) {
+    const {ctx, _longestTextCache: caches} = this;
     const widths = [];
     const heights = [];
-    const offsets = [];
     let widestLabelSize = 0;
     let highestLabelSize = 0;
-    let ticks = me.ticks;
-    if (sampleSize < ticks.length) {
-      ticks = sample(ticks, sampleSize);
-    }
-    const length = ticks.length;
     let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;
 
     for (i = 0; i < length; ++i) {
       label = ticks[i].label;
-      tickFont = me._resolveTickFontOptions(i);
+      tickFont = this._resolveTickFontOptions(i);
       ctx.font = fontString = tickFont.string;
       cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};
       lineHeight = tickFont.lineHeight;
@@ -1043,7 +1027,6 @@ export default class Scale extends Element {
       }
       widths.push(width);
       heights.push(height);
-      offsets.push(lineHeight / 2);
       widestLabelSize = Math.max(width, widestLabelSize);
       highestLabelSize = Math.max(height, highestLabelSize);
     }
@@ -1052,13 +1035,7 @@ export default class Scale extends Element {
     const widest = widths.indexOf(widestLabelSize);
     const highest = heights.indexOf(highestLabelSize);
 
-    function valueAt(idx) {
-      return {
-        width: widths[idx] || 0,
-        height: heights[idx] || 0,
-        offset: offsets[idx] || 0
-      };
-    }
+    const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});
 
     return {
       first: valueAt(0),
@@ -1299,7 +1276,7 @@ export default class Scale extends Element {
       tx2 = me.left + tl;
     } else if (axis === 'x') {
       if (position === 'center') {
-        borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2);
+        borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);
       } else if (isObject(position)) {
         const positionAxisID = Object.keys(position)[0];
         const value = position[positionAxisID];
@@ -1458,24 +1435,20 @@ export default class Scale extends Element {
         x = pixel;
         if (position === 'top') {
           if (crossAlign === 'near' || rotation !== 0) {
-            textOffset = (Math.sin(rotation) * halfCount + 0.5) * lineHeight;
-            textOffset -= (rotation === 0 ? (lineCount - 0.5) : Math.cos(rotation) * halfCount) * lineHeight;
+            textOffset = -lineCount * lineHeight + lineHeight / 2;
           } else if (crossAlign === 'center') {
-            textOffset = -1 * (labelSizes.highest.height / 2);
-            textOffset -= halfCount * lineHeight;
+            textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
           } else {
-            textOffset = (-1 * labelSizes.highest.height) + (0.5 * lineHeight);
+            textOffset = -labelSizes.highest.height + lineHeight / 2;
           }
         } else {
           // eslint-disable-next-line no-lonely-if
           if (crossAlign === 'near' || rotation !== 0) {
-            textOffset = Math.sin(rotation) * halfCount * lineHeight;
-            textOffset += (rotation === 0 ? 0.5 : Math.cos(rotation) * halfCount) * lineHeight;
+            textOffset = lineHeight / 2;
           } else if (crossAlign === 'center') {
-            textOffset = labelSizes.highest.height / 2;
-            textOffset -= halfCount * lineHeight;
+            textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;
           } else {
-            textOffset = labelSizes.highest.height - ((lineCount - 0.5) * lineHeight);
+            textOffset = labelSizes.highest.height - lineCount * lineHeight;
           }
         }
       } else {
@@ -1522,12 +1495,10 @@ export default class Scale extends Element {
 
   _getYAxisLabelAlignment(tl) {
     const me = this;
-    const {position, ticks} = me.options;
-    const {crossAlign, mirror, padding} = ticks;
+    const {position, ticks: {crossAlign, mirror, padding}} = me.options;
     const labelSizes = me._getLabelSizes();
     const tickAndPadding = tl + padding;
     const widest = labelSizes.widest.width;
-    const lineSpace = labelSizes.highest.offset * 0.8;
 
     let textAlign;
     let x;
@@ -1546,7 +1517,7 @@ export default class Scale extends Element {
           x -= (widest / 2);
         } else {
           textAlign = 'left';
-          x = me.left + lineSpace;
+          x = me.left;
         }
       }
     } else if (position === 'right') {
@@ -1563,7 +1534,7 @@ export default class Scale extends Element {
           x += widest / 2;
         } else {
           textAlign = 'right';
-          x = me.right - lineSpace;
+          x = me.right;
         }
       }
     } else {
index 3ffb6841a9105fe7e5f5f3dc284f3111dd402d06..4b8335a436d370750d94727724b65d41332995fc 100644 (file)
Binary files a/test/fixtures/controller.bar/minBarLength/horizontal-neg.png and b/test/fixtures/controller.bar/minBarLength/horizontal-neg.png differ
index 7999ebbbaaee8d6f64f2b0f9fb8e7ceeb15978eb..b19acd76753cc57c029b46993024c39cc4be440a 100644 (file)
Binary files a/test/fixtures/controller.bar/minBarLength/horizontal-pos.png and b/test/fixtures/controller.bar/minBarLength/horizontal-pos.png differ
index 83d5b82dc18696f85d40a8b1b29ee0eccc4ce3ff..39b1d3f12523224887251a8c77749777fc977fcd 100644 (file)
Binary files a/test/fixtures/controller.bar/minBarLength/horizontal.png and b/test/fixtures/controller.bar/minBarLength/horizontal.png differ
index 92506bd3ae7b05f5d7f791ed195efbe3c361ccd3..9ed7d0ca20049a2292d93223d440b6355499786c 100644 (file)
Binary files a/test/fixtures/controller.bar/not-grouped/on-time.png and b/test/fixtures/controller.bar/not-grouped/on-time.png differ
index 2c2c454de75ed49604df4e94fc935f0caead96c6..6ce0ce1247cce43725ef9067cd80917ed238c008 100644 (file)
Binary files a/test/fixtures/controller.bubble/clip.png and b/test/fixtures/controller.bubble/clip.png differ
index d5010ad1726e9c3c570c7e2a6ba145c5a83e1bd4..4379fba82e9777ddf52c35ea8c28b5908b22f376 100644 (file)
Binary files a/test/fixtures/controller.line/clip/default-x-max.png and b/test/fixtures/controller.line/clip/default-x-max.png differ
index 7f406b11e95cca748e82808f688f76f0b63ddd66..f76bbf52a37768102ede14039d5cbe19bd2cb6be 100644 (file)
Binary files a/test/fixtures/controller.line/clip/default-x-min.png and b/test/fixtures/controller.line/clip/default-x-min.png differ
index a409d197968113c3dd233996f26546c7bb2f290b..7b40d7718506b19a4d7b85d12b7077e307bdf5c2 100644 (file)
Binary files a/test/fixtures/controller.line/clip/default-x.png and b/test/fixtures/controller.line/clip/default-x.png differ
index cb41b2e71f9e22cf0527b59f2834e364270efc09..75aaec9841a1da61f98e19a9e6e982f962f08d54 100644 (file)
Binary files a/test/fixtures/controller.line/clip/default-y-max.png and b/test/fixtures/controller.line/clip/default-y-max.png differ
index 356eff3b076d0c1778f081f7a611109048da2b05..2db3da79f2d35c55064e82daf2e8310f1adb2eaa 100644 (file)
Binary files a/test/fixtures/controller.line/clip/default-y-min.png and b/test/fixtures/controller.line/clip/default-y-min.png differ
index 745b998707447195e2b5b8ecd57804df3e2ced17..6fe1d01dc415ea259e0f0faa3288f3c49422401c 100644 (file)
Binary files a/test/fixtures/controller.line/clip/default-y.png and b/test/fixtures/controller.line/clip/default-y.png differ
index 6aa531c976d96de23384c3d43eb4c7703aea09b7..0f7eeef7cd73f80922e9e90d1ceff2a52947723a 100644 (file)
Binary files a/test/fixtures/controller.line/clip/specified.png and b/test/fixtures/controller.line/clip/specified.png differ
index 3142b96f39632464a066523c9a9eae5d5446d118..a236a4c48c31463de67ee5b5ab55331072aaf339 100644 (file)
Binary files a/test/fixtures/core.layouts/hidden-vertical-boxes.png and b/test/fixtures/core.layouts/hidden-vertical-boxes.png differ
index c12a70a8711a21b79869ca2dcabe5911326340f7..5f20aa5aaf2c47c2974a67e4f5cd4037f797408f 100644 (file)
Binary files a/test/fixtures/core.layouts/long-labels.png and b/test/fixtures/core.layouts/long-labels.png differ
index e18af5ca6653f90d0ad0d827fef1dc49285a0c03..c28d8c7dd5d4e6894dd857a24e048b93ee3749e1 100644 (file)
Binary files a/test/fixtures/core.layouts/refit-vertical-boxes.png and b/test/fixtures/core.layouts/refit-vertical-boxes.png differ
index 6b3da5d1017fd376380aefccb626fa04e233b818..a96bfa9f2e2ee271537dd3ccbde77a34a6e54c92 100644 (file)
Binary files a/test/fixtures/core.layouts/scriptable.png and b/test/fixtures/core.layouts/scriptable.png differ
index cfc1b7a42a569a334683e4cb3965048721fa42c1..c1def972292e58bc4018167aeb2a78efd5f5d65b 100644 (file)
Binary files a/test/fixtures/core.scale/autoSkip/fit-after.png and b/test/fixtures/core.scale/autoSkip/fit-after.png differ
index 9a24900a7f77cb0e63cb63a7ba1a9250105c41be..f8d2d185170571063b5a94549e178fdf8a532eae 100644 (file)
Binary files a/test/fixtures/core.scale/autoSkip/no-offset.png and b/test/fixtures/core.scale/autoSkip/no-offset.png differ
index 6c1f8c62d1ec9b4e9f6ded1c83e90b0c18970f2b..72ee4eef4a161225e9a40c67f1d1c7f10914de02 100644 (file)
Binary files a/test/fixtures/core.scale/autoSkip/offset.png and b/test/fixtures/core.scale/autoSkip/offset.png differ
index 5855420b93150a8ed707eb1799fcfc38a8d8cf44..19d6e583a560a956c01445522727d6e72f2a2222 100644 (file)
Binary files a/test/fixtures/core.scale/backgroundColor.png and b/test/fixtures/core.scale/backgroundColor.png differ
index a36dd25354226699c8b3657ac09731c7b780badb..8a9759c55a68ad28dae1e126bf91569d433719af 100644 (file)
Binary files a/test/fixtures/core.scale/cartesian-axis-border-settings.png and b/test/fixtures/core.scale/cartesian-axis-border-settings.png differ
index b817e5bc3bf11fad1874edd445a0f58343d743dc..6f3aaed90fede449c7824693395e278962c9386c 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-bottom-center.png and b/test/fixtures/core.scale/crossAlignment/cross-align-bottom-center.png differ
index 6dd7a50fa5a66257fcc36fc7bd9960779672016c..abca217fa27f97b0c881af22ab4b1beebab8c863 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-bottom-far.png and b/test/fixtures/core.scale/crossAlignment/cross-align-bottom-far.png differ
index a7bfa8de1da6c4a3ff3fbb108fa854fa68b6f1cf..02791ad91bb9cbc29a42dc2b0ff093d0c1d84e44 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-bottom-near.png and b/test/fixtures/core.scale/crossAlignment/cross-align-bottom-near.png differ
index 747d7049361cc0d393152e66636472c076357dbb..004856cedea2fd442bb2deaa0b20b134247a6942 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-left-center.png and b/test/fixtures/core.scale/crossAlignment/cross-align-left-center.png differ
index 75258b70be7eb52771cf8f4972133da61a6be10d..d0cb6e397782bfbd38fe23c3c64abcd202baeda0 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-left-far-clipped.png and b/test/fixtures/core.scale/crossAlignment/cross-align-left-far-clipped.png differ
index be066d19b8bb97b55624cc52795f00627176ca36..79b92fde7e9875e4b95e4a6dd70cb919b44a149b 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-left-far.png and b/test/fixtures/core.scale/crossAlignment/cross-align-left-far.png differ
index 50d27b83aed3bd5c6427a271d20960280c031392..c9cae15fcc45850ce944778fa00079c652ea46b5 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-left-near.png and b/test/fixtures/core.scale/crossAlignment/cross-align-left-near.png differ
index baa12cb7fad6844d367b60d729bf68391ca8be9f..ca66bcd9b961a044ae5e33ad19d358b752204260 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-right-center.png and b/test/fixtures/core.scale/crossAlignment/cross-align-right-center.png differ
index ae02309c1bdab18d49ab9d61ed50bb2a9adfe360..10678359a81f5bb03d4cfa36ddb621e715ede9cc 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-right-far.png and b/test/fixtures/core.scale/crossAlignment/cross-align-right-far.png differ
index d0cd8112274075249a1de7238d1cb41bba7443fe..5352cbb72efccfb4e0843d26b5150af9d9c8d5f4 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-right-near.png and b/test/fixtures/core.scale/crossAlignment/cross-align-right-near.png differ
index 4f5eb963c5d25e74c84cc24fc7f63db7349cf734..c9083a830d8a17530ba41a7ecd7502496a0eae38 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-top-center.png and b/test/fixtures/core.scale/crossAlignment/cross-align-top-center.png differ
index ea5c88d501c83abf496523e0ab92be443c59f9e1..b186168a8d9e3abf019ef101e624a5f6094ade07 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-top-far.png and b/test/fixtures/core.scale/crossAlignment/cross-align-top-far.png differ
index 932166863ef2756c3b1556f8bc718113edec646d..ce9e5c67a8b955dc925973b5989ae3f1da353ec3 100644 (file)
Binary files a/test/fixtures/core.scale/crossAlignment/cross-align-top-near.png and b/test/fixtures/core.scale/crossAlignment/cross-align-top-near.png differ
index 576f0254d0a2090582529f7cb63651e5c5b8a578..e0b0d2030e0d7d457589bd155aa7c2f9f6688a19 100644 (file)
Binary files a/test/fixtures/core.scale/label-align-center.png and b/test/fixtures/core.scale/label-align-center.png differ
index 8581fc922c6cccf2afd90bafb86b540594605188..57640fd21c8574ff97fefdffd35bd27afa0799e4 100644 (file)
Binary files a/test/fixtures/core.scale/label-align-end.png and b/test/fixtures/core.scale/label-align-end.png differ
index 13098ae904f449999bff195708b15c87643ee17c..18941892f89c928fa5e44243440d0c51153fb506 100644 (file)
Binary files a/test/fixtures/core.scale/label-align-start.png and b/test/fixtures/core.scale/label-align-start.png differ
index 05785b8bc597181170ffe7bae4e472f35f8a0620..bf9da7b767645df19140757bd593ad1aad965aee 100644 (file)
Binary files a/test/fixtures/core.scale/label-offset-vertical-axes.png and b/test/fixtures/core.scale/label-offset-vertical-axes.png differ
index b59f3a6f94776ea790e3cd7e7bc8780da4dbfa45..6c34af30f71b8d00ff4bafb2b159b765d4308304 100644 (file)
Binary files a/test/fixtures/core.scale/tick-drawing.png and b/test/fixtures/core.scale/tick-drawing.png differ
index 8e55ea433f2513a425384520daf62a8eebb6aadd..568fdf5afb94c8e8448bad82d2696fb1f1a7f83a 100644 (file)
Binary files a/test/fixtures/core.scale/tick-override-styles.png and b/test/fixtures/core.scale/tick-override-styles.png differ
index 15a23c2f16e5b92642f22c8eecf09c65e2995066..dc483b516377e20e4e5766fb604f7456b19fb789 100644 (file)
Binary files a/test/fixtures/core.scale/ticks-mirror.png and b/test/fixtures/core.scale/ticks-mirror.png differ
diff --git a/test/fixtures/core.scale/ticks/rotated-long.js b/test/fixtures/core.scale/ticks/rotated-long.js
new file mode 100644 (file)
index 0000000..3009d4c
--- /dev/null
@@ -0,0 +1,47 @@
+module.exports = {
+  config: {
+    type: 'line',
+    data: {
+      labels: ['Red Red Red Red', 'Blue Blue Blue Blue', 'Black Black Black Black', 'Green Green Green Green', 'Purple Purple Purple Purple', 'Orange Orange Orange Orange Orange Orange'],
+      datasets: [
+        {
+          data: [12, 19, 3, 5, 2, 3]
+        },
+      ]
+    },
+    options: {
+      plugins: {
+        legend: false,
+        tooltip: false,
+        filler: false,
+        title: false
+      },
+      scales: {
+        bottom: {
+          type: 'category',
+          position: 'bottom'
+        },
+        top: {
+          type: 'category',
+          position: 'top'
+        }
+      }
+    },
+    plugins: [{
+      afterDraw(chart) {
+        const ctx = chart.ctx;
+        ctx.save();
+        ctx.strokeStyle = 'red';
+        ctx.strokeRect(0, 0, chart.width, chart.height);
+        ctx.restore();
+      }
+    }]
+  },
+  options: {
+    spriteText: true,
+    canvas: {
+      width: 1024,
+      height: 512
+    }
+  }
+};
diff --git a/test/fixtures/core.scale/ticks/rotated-long.png b/test/fixtures/core.scale/ticks/rotated-long.png
new file mode 100644 (file)
index 0000000..04bc0b6
Binary files /dev/null and b/test/fixtures/core.scale/ticks/rotated-long.png differ
diff --git a/test/fixtures/core.scale/ticks/rotated-multi-line.js b/test/fixtures/core.scale/ticks/rotated-multi-line.js
new file mode 100644 (file)
index 0000000..271c0b3
--- /dev/null
@@ -0,0 +1,47 @@
+module.exports = {
+  config: {
+    type: 'line',
+    data: {
+      labels: [['Red', 'Red', 'Red', 'Red'], ['Blue', 'Blue', 'Blue', 'Blue'], ['Black', 'Black', 'Black', 'Black'], ['Green', 'Green', 'Green', 'Green'], ['Purple', 'Purple', 'Purple', 'Purple'], ['Orange Orange', 'Orange', 'Orange', 'Orange', 'Orange Orange']],
+      datasets: [
+        {
+          data: [12, 19, 3, 5, 2, 3]
+        },
+      ]
+    },
+    options: {
+      plugins: {
+        legend: false,
+        tooltip: false,
+        filler: false,
+        title: false
+      },
+      scales: {
+        bottom: {
+          type: 'category',
+          position: 'bottom'
+        },
+        top: {
+          type: 'category',
+          position: 'top'
+        }
+      }
+    },
+    plugins: [{
+      afterDraw(chart) {
+        const ctx = chart.ctx;
+        ctx.save();
+        ctx.strokeStyle = 'red';
+        ctx.strokeRect(0, 0, chart.width, chart.height);
+        ctx.restore();
+      }
+    }]
+  },
+  options: {
+    spriteText: true,
+    canvas: {
+      width: 610,
+      height: 512
+    }
+  }
+};
diff --git a/test/fixtures/core.scale/ticks/rotated-multi-line.png b/test/fixtures/core.scale/ticks/rotated-multi-line.png
new file mode 100644 (file)
index 0000000..4c46fc3
Binary files /dev/null and b/test/fixtures/core.scale/ticks/rotated-multi-line.png differ
index f52a7bf7346ca22024125c05556e50e893a0f016..dbd5397fa9efaec3045acae82e7cb8b7e90ba305 100644 (file)
Binary files a/test/fixtures/core.scale/title/align-end.png and b/test/fixtures/core.scale/title/align-end.png differ
index 7a1317ec1c203bae9eaffe1e3afbfdc6bee2f6ca..21ffbea2699acb23b32441acfbd3c617316fc795 100644 (file)
Binary files a/test/fixtures/core.scale/title/align-start.png and b/test/fixtures/core.scale/title/align-start.png differ
index 155da25ecb477d3510e0d22d833025564e7830f5..326db59e5405a5559b37955b8dd6824b317c25cb 100644 (file)
Binary files a/test/fixtures/core.scale/title/multi-line/align-end.png and b/test/fixtures/core.scale/title/multi-line/align-end.png differ
index dcba4607aeb52bb9bf552f1523a9fb6bc333113f..b653aa5b6ed7a4c6d51368b8c41e26f67bd9bf85 100644 (file)
Binary files a/test/fixtures/core.scale/title/multi-line/align-start.png and b/test/fixtures/core.scale/title/multi-line/align-start.png differ
index f984570859bad411ad1ca95086a21f0007839b68..284056f509c44bf7f91e914b2ffe400720b90d50 100644 (file)
Binary files a/test/fixtures/core.scale/x-axis-position-center.png and b/test/fixtures/core.scale/x-axis-position-center.png differ
index cfee585b6ca08f19252adc8614104522323a7564..62fc3ec86e7912fcc44d030cd2485f908cf518ee 100644 (file)
Binary files a/test/fixtures/core.scale/x-axis-position-dynamic.png and b/test/fixtures/core.scale/x-axis-position-dynamic.png differ
index 5d741d1880a1be84ac02ab28dad3d6f667d37c52..a2e6f0110bce1b6220f89e85b1630065d2b10aa7 100644 (file)
Binary files a/test/fixtures/core.scale/y-axis-position-center.png and b/test/fixtures/core.scale/y-axis-position-center.png differ
index 33863ea8f96e3b0266bde6b84bed05788c907204..a3a38a5d11c43e856f61b0000fd3156d604a1dd7 100644 (file)
Binary files a/test/fixtures/core.scale/y-axis-position-dynamic.png and b/test/fixtures/core.scale/y-axis-position-dynamic.png differ
index e366a8aa0c0f12911c4077070a7ccb7221ad8377..921a510fd38853daeea7faae49375bcb6fc79d5c 100644 (file)
Binary files a/test/fixtures/mixed/bar+line.png and b/test/fixtures/mixed/bar+line.png differ
index 9c3fc405ed7d654e2ae2895cecc6962cf9fd16da..8bc1d66e93644a2625d0f99c356aa77d38691e89 100644 (file)
Binary files a/test/fixtures/scale.category/ticks-from-data.png and b/test/fixtures/scale.category/ticks-from-data.png differ
index fbe444b3847f71ce10a3b8ea9faa7a8bdf9ea5ac..76ffd239d723d5f1f753f92763c9bc0673e519f0 100644 (file)
Binary files a/test/fixtures/scale.linear/grace-neg.png and b/test/fixtures/scale.linear/grace-neg.png differ
index e6b654505899ac04bf3af32930559f8528e2771a..bb902fee9c999f9d9b65868f2be782d3df43536f 100644 (file)
Binary files a/test/fixtures/scale.linear/grace-pos.png and b/test/fixtures/scale.linear/grace-pos.png differ
index b7556e412eda2a4fd730c08187497d59b5de958a..5e45396829e14432d74381a9a6d3b617180e7a47 100644 (file)
Binary files a/test/fixtures/scale.linear/grace.png and b/test/fixtures/scale.linear/grace.png differ
index 9141f8d20de76413bc9ead7019ed8ef063d0715e..1ede564936425c06f8bf2319efdc0cc71f244e60 100644 (file)
Binary files a/test/fixtures/scale.linear/min-max-skip.png and b/test/fixtures/scale.linear/min-max-skip.png differ
index bb365bcd1f150ed78c51b883884e3627031be641..fd3f4ebbd1a37e5fff50f22eccdf72c520808235 100644 (file)
Binary files a/test/fixtures/scale.linear/tick-count-data-limits.png and b/test/fixtures/scale.linear/tick-count-data-limits.png differ
index dea42ece524ee5fedfa0a124e4a75e532e11d3b7..6e4b21d9f4ebd0a33dc4393ea76e44a9a6f0aba0 100644 (file)
Binary files a/test/fixtures/scale.linear/tick-count-min-max-not-aligned.png and b/test/fixtures/scale.linear/tick-count-min-max-not-aligned.png differ
index dcba5ad841f3c09c4ed6f38f2a8e31c314c9c222..a82179124e72815fcbfa31d81e80e9f8b11a53b7 100644 (file)
Binary files a/test/fixtures/scale.linear/tick-count-min-max.png and b/test/fixtures/scale.linear/tick-count-min-max.png differ
index dea42ece524ee5fedfa0a124e4a75e532e11d3b7..6e4b21d9f4ebd0a33dc4393ea76e44a9a6f0aba0 100644 (file)
Binary files a/test/fixtures/scale.linear/tick-step-min-max.png and b/test/fixtures/scale.linear/tick-step-min-max.png differ
index bc537d10a9e26628e77327753ac0ca486149ed9f..a336cd10e4167b6d2f4b06ced968f353c29ffc8b 100644 (file)
Binary files a/test/fixtures/scale.linear/tiny-numbers.png and b/test/fixtures/scale.linear/tiny-numbers.png differ
index 6888ad6367e06607cf21bc692e92ac148fa03db2..0c1d3a323b428f24b0ebfc968ea6f2f3d923f6c9 100644 (file)
Binary files a/test/fixtures/scale.time/autoskip-major.png and b/test/fixtures/scale.time/autoskip-major.png differ
index e3496e04f62e03eb276e4beb13911640c8a499af..8a449a39e4c5aa4a41f3dd9329f553e9a3750190 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0025,
   config: {
     type: 'line',
     data: {
index 4c41f5ad0a23bc5c5d4852f10aa9bdc2f02e551f..adc1d7682567476059203bc0df2bfa3b54cf5b8f 100644 (file)
Binary files a/test/fixtures/scale.time/custom-parser.png and b/test/fixtures/scale.time/custom-parser.png differ
index 5565c3e0d338ac58003a569f54689f3f03a0338b..0b0bb53272f21f0865ec5c93f0b85566d64c05b9 100644 (file)
@@ -4,6 +4,7 @@ function newDateFromRef(days) {
 
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.003,
   config: {
     type: 'line',
     data: {
index db373eb14483162b03b390e39e81d907dafaa960..c1a05e72a2a0135348ac65758c52f1d1c34bf2c0 100644 (file)
Binary files a/test/fixtures/scale.time/data-ty.png and b/test/fixtures/scale.time/data-ty.png differ
index 4e582a2977cc3e95ba7782b68c3b92deabe7b64f..759fdf3d554220fd4fa443f5ff1fd7efd085794b 100644 (file)
@@ -4,6 +4,7 @@ function newDateFromRef(days) {
 
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.003,
   config: {
     type: 'line',
     data: {
index db373eb14483162b03b390e39e81d907dafaa960..c1a05e72a2a0135348ac65758c52f1d1c34bf2c0 100644 (file)
Binary files a/test/fixtures/scale.time/data-xy.png and b/test/fixtures/scale.time/data-xy.png differ
index 2257064a27162c6ef086e44f2907673b0492c3e4..60c1ec16f9588e71ff77e34c5b5b2e4a1a5aa990 100644 (file)
Binary files a/test/fixtures/scale.time/invalid-data.png and b/test/fixtures/scale.time/invalid-data.png differ
index 2a79b6fa26b37709816a313809b0f7082c888c8d..165f9ab14f9c11f27b7d6343365df99fa4af26c7 100644 (file)
@@ -3,7 +3,8 @@ function newDateFromRef(days) {
 }
 
 module.exports = {
-  threshold: 0.01,
+  threshold: 0.1,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index ac95ea0cde3b0f3b21b0f5f71f967bddf4ec1788..865729c65e62d88dffc1d013eecac7744a6d1793 100644 (file)
Binary files a/test/fixtures/scale.time/labels-date.png and b/test/fixtures/scale.time/labels-date.png differ
index c9e83075c4d9da34bbfda8625bad1025b1c650e6..2417c48e619080c420d06aecda888111a1b81fb3 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
-  threshold: 0.01,
+  threshold: 0.05,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index ac95ea0cde3b0f3b21b0f5f71f967bddf4ec1788..865729c65e62d88dffc1d013eecac7744a6d1793 100644 (file)
Binary files a/test/fixtures/scale.time/labels-strings.png and b/test/fixtures/scale.time/labels-strings.png differ
index 6f63c191d1aed42a31e998163ff9c09ea106aba8..0ec95e019711d10d97652a7ae9d9211c3e84c52d 100644 (file)
@@ -8,6 +8,7 @@ var timeOpts = {
 
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index 5170f5131a069da4d8627145575b9acba250f7fe..a6c3db6a0dd176b382dfccd100058167a8e407de 100644 (file)
Binary files a/test/fixtures/scale.time/labels.png and b/test/fixtures/scale.time/labels.png differ
index 7f0a88149d78a561b214e34c61de97ded95e2dad..8bb66db48ff0404d3f1dc039607afe65981fd948 100644 (file)
Binary files a/test/fixtures/scale.time/negative-times.png and b/test/fixtures/scale.time/negative-times.png differ
index 9bea4ec59ad1688c3789d35b15a93336a2ec2a4e..a43c8c00604e94f71484f31b1ddcbfcbe5c1f138 100644 (file)
Binary files a/test/fixtures/scale.time/offset-with-no-ticks.png and b/test/fixtures/scale.time/offset-with-no-ticks.png differ
index a7bfc60dbae310fbb6c2edddd2cc58fa18146c1f..3313ecd29a04df3117d538cc119588fe2869d492 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0025,
   config: {
     type: 'line',
     data: {
index 004842c4628c5ce92215218dabe3d8da002d18ac..fb668ecc209b88085940fe8668a652108cadd2ad 100644 (file)
Binary files a/test/fixtures/scale.time/source-auto-linear.png and b/test/fixtures/scale.time/source-auto-linear.png differ
index a9d9742c341985c2c0c72a99faa9f5bd7fb793d1..34c00ba81eedd0c6555d1a16d5879fd2048ecb66 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     type: 'line',
     data: {
index bfff4d84647c26dd49ede92b3f4752cb116236f6..3b4d1a03c3e62e3df01b48cff334ffee10df0ab4 100644 (file)
Binary files a/test/fixtures/scale.time/source-data-linear.png and b/test/fixtures/scale.time/source-data-linear.png differ
index a09b83238d20ff295a425d3d25f7330707053c0d..4b54a3d072ec7739599b70f86d16ac9e6c2fd98e 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     type: 'line',
     data: {
index 3d7ed5d5de347c229f34ecfa9efedffdb0217dcb..f7c2fbe9da40385f77ee793e3435ea9927dfdbc5 100644 (file)
Binary files a/test/fixtures/scale.time/source-labels-linear-offset-min-max.png and b/test/fixtures/scale.time/source-labels-linear-offset-min-max.png differ
index 19aebba64afb371f10186c7f8e75c5a8cd4b338e..69565ff7e36924ed379b21ef96545ed41d0b4d2c 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     type: 'line',
     data: {
index bfff4d84647c26dd49ede92b3f4752cb116236f6..3b4d1a03c3e62e3df01b48cff334ffee10df0ab4 100644 (file)
Binary files a/test/fixtures/scale.time/source-labels-linear.png and b/test/fixtures/scale.time/source-labels-linear.png differ
index 8cc6200dcfa4ae2ef91b1b4ce4af6f8ae550549b..225bc916484ff4cc194de68f9857a692efe26e9e 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index 9c5524d955a4f97001645dc75e832ea8a0faf4c4..b17a91cb892b639bc772ba694638f6fe1746adeb 100644 (file)
Binary files a/test/fixtures/scale.time/ticks-capacity.png and b/test/fixtures/scale.time/ticks-capacity.png differ
index 05b9595f5a1e5704c4fa7b8d1de994fd7c5b6433..43836601919390a27064f9f95a1dd5fcd5807413 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index 861870dd0df2b8e93972ca07c6a35175f6b7eac3..dbe3221453fb90f6dda38ef90c5a2c4811290da9 100644 (file)
Binary files a/test/fixtures/scale.time/ticks-minunit.png and b/test/fixtures/scale.time/ticks-minunit.png differ
index 0f5a1080129ad37c4836a75bfeedb85fa410b9fb..6785fdf13a5e16ccf963c7dba245fc0479595fea 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     type: 'line',
     data: {
index 5638c06dfd961a36110dcaeb3fc39d9978592440..01c9c76310885b7543df9151e613fa2c8636da59 100644 (file)
Binary files a/test/fixtures/scale.time/ticks-reverse-linear-min-max.png and b/test/fixtures/scale.time/ticks-reverse-linear-min-max.png differ
index 10c62a2f9dfb04ed246163e60e4d0c931bf531ab..992504c1cc93f2e76b04ec69b06b23f94381fb3d 100644 (file)
Binary files a/test/fixtures/scale.time/ticks-reverse-linear.png and b/test/fixtures/scale.time/ticks-reverse-linear.png differ
index 7975115c5a4cb6c9fdc2cd144bf0a84ec231ad30..37a3ebb89f9c1d3c3fb5722beb2b30d1cf244cc0 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index 4744479f4748660ce6304a9734f15b616d538545..91ed7304fcf7fc99820eb5b9e082b3b2d5b22ca8 100644 (file)
Binary files a/test/fixtures/scale.time/ticks-reverse-offset.png and b/test/fixtures/scale.time/ticks-reverse-offset.png differ
index fd8daab718de42190933d7e0ad4e643497f1876c..02df39fce1c6429f63aacd96204199b3ffa85037 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     type: 'line',
     data: {
index 383e5eec114b3a55f953fb39aaef62fa9b1be468..7fb0144390cbac3302c622378475a026f0dc20f0 100644 (file)
Binary files a/test/fixtures/scale.time/ticks-reverse.png and b/test/fixtures/scale.time/ticks-reverse.png differ
index e969ba1365d9ac0421f676793a059b081afdf234..eb1317eaa28e256f5d4a476f2ed70836d7bd9473 100644 (file)
Binary files a/test/fixtures/scale.time/ticks-round.png and b/test/fixtures/scale.time/ticks-round.png differ
index 005f38b61bedd56cca3de9bc9985bb12030f687d..bb192fb0ccddb792f40663d7687070473aae98f5 100644 (file)
Binary files a/test/fixtures/scale.time/ticks-stepsize.png and b/test/fixtures/scale.time/ticks-stepsize.png differ
index b725c5ff1bfaf5333d985ba36c091d4a40521efd..b18150b07fb14d51c4e3dcc41b750f066d05a08e 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
-  threshold: 0.01,
+  threshold: 0.05,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index 08210e77b971bfd530a779849b8e603b304eff0b..a9867b48983ac95b5cc1f4b43e12bc0c2f9e3ac9 100644 (file)
Binary files a/test/fixtures/scale.time/ticks-unit.png and b/test/fixtures/scale.time/ticks-unit.png differ
index 249572f2b2b3495a2a2b5f325a37772112e49d2c..465f70f3d19628846112a896a76ef77434f3a9b8 100644 (file)
@@ -2,6 +2,7 @@ const data = [{x: 631180800000, y: 31.80}, {x: 631267200000, y: 30.20}, {x: 6313
 
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     data: {
       datasets: [{
index 1daf5786a75fc052f75a11434fdec60ff8a8198f..659c0a1dae273d629a5a893e041a830e6ad2ddf9 100644 (file)
Binary files a/test/fixtures/scale.timeseries/financial-daily.png and b/test/fixtures/scale.timeseries/financial-daily.png differ
index b87b30e3df84a0a12bd63b581b31c1de06bb55bc..af1d8c0422d6b17aa3e8e7e9c158e5ec11173843 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index 37d90a43fab03a1e2ac423c030755ea044f6fa2d..ea7fb8ce289aee102de6e8a25a7754b7705a5a21 100644 (file)
Binary files a/test/fixtures/scale.timeseries/normalize.png and b/test/fixtures/scale.timeseries/normalize.png differ
index e53922bb4fb80bcbd77ebae14257ec34989fb337..8149437753627b1694e3e3c16b9531819f6c1999 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0025,
   config: {
     type: 'line',
     data: {
index c1a9facf675f277115c5eebb2b1a87570a5a5391..532509c394b5d67851caaf086b452749a4978ad7 100644 (file)
Binary files a/test/fixtures/scale.timeseries/source-auto.png and b/test/fixtures/scale.timeseries/source-auto.png differ
index e63b5dc5e768fd36720cfb1506522e3597bb2616..84e9a265253eebfdb55c762da913636bb226c822 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index 35c9509047882a7c57c32cd7392e13db3eac56fa..a23747193291c127016d3cb2b59999323303dc40 100644 (file)
Binary files a/test/fixtures/scale.timeseries/source-data-offset-min-max.png and b/test/fixtures/scale.timeseries/source-data-offset-min-max.png differ
index 2601cb35130a25cc9b5d4d33b10423a01a95157b..ae3a3e1ccd965dae40faef2a37484edf2ce5348b 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     type: 'line',
     data: {
index f1f8665fd4a1a8f6dd2a6f2ebe5c86d014549777..b352b93f27613edc9f9ecf498ac5effd40065119 100644 (file)
Binary files a/test/fixtures/scale.timeseries/source-data.png and b/test/fixtures/scale.timeseries/source-data.png differ
index 9c71c65571107138315b157ccd72156c9dc45feb..897a2fd75508666478cb9f6600b4cacb9af1a8ab 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     type: 'line',
     data: {
index 35c9509047882a7c57c32cd7392e13db3eac56fa..a23747193291c127016d3cb2b59999323303dc40 100644 (file)
Binary files a/test/fixtures/scale.timeseries/source-labels-offset-min-max.png and b/test/fixtures/scale.timeseries/source-labels-offset-min-max.png differ
index 0087f4a568364b54b7b598a5fc6701336597314c..8b02c83d18bd5444912c78ece23714ebd86ba1ce 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     type: 'line',
     data: {
index f1f8665fd4a1a8f6dd2a6f2ebe5c86d014549777..b352b93f27613edc9f9ecf498ac5effd40065119 100644 (file)
Binary files a/test/fixtures/scale.timeseries/source-labels.png and b/test/fixtures/scale.timeseries/source-labels.png differ
index 6ba3fabb45fa6506ca94968639b475486b3eb775..1189549dbf5e3868c42f491ebc07a017951aa6fe 100644 (file)
Binary files a/test/fixtures/scale.timeseries/ticks-reverse-max.png and b/test/fixtures/scale.timeseries/ticks-reverse-max.png differ
index 4d892b650082d5a50519afbecadd0fd63dff3635..4222a2e8d8818a61d40f61243ca571a5aa349373 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.002,
   config: {
     type: 'line',
     data: {
index 490c68dda26a1ca46af93cc17f2d6fb576550def..f6c66ec676f45746c39570454a0ad64edd077fee 100644 (file)
Binary files a/test/fixtures/scale.timeseries/ticks-reverse-min-max.png and b/test/fixtures/scale.timeseries/ticks-reverse-min-max.png differ
index 340557d4baf0fa6f61d662e16cc3784f2af9b5b2..97315b374c5ed98b57c9ffd40d8b9d67bbd809ed 100644 (file)
Binary files a/test/fixtures/scale.timeseries/ticks-reverse-min.png and b/test/fixtures/scale.timeseries/ticks-reverse-min.png differ
index 237b473d7b61cae1fff4e151a9c5e51373c80fb1..f71c6d8e89be86f3005d69bc48d2b38d4e450487 100644 (file)
@@ -1,5 +1,6 @@
 module.exports = {
   threshold: 0.01,
+  tolerance: 0.0015,
   config: {
     type: 'line',
     data: {
index 5de56dcd1a4dcb0cd3f890229db75e7d9b166e8c..d7d13f4ee96720a4a301b20c99289fc76ef5ef4e 100644 (file)
Binary files a/test/fixtures/scale.timeseries/ticks-reverse.png and b/test/fixtures/scale.timeseries/ticks-reverse.png differ
index 08436e93bc1cc6ecd559876cee336fd49803ae89..fc3a601ed6216f642750918e81ea62ab1e239656 100644 (file)
@@ -1485,8 +1485,8 @@ describe('Chart', function() {
         'afterDataLimits',
         'beforeBuildTicks',
         'afterBuildTicks',
-        'beforeBuildTicks', // y-axis re-fit
-        'afterBuildTicks',
+        // 'beforeBuildTicks', // y-axis re-fit
+        // 'afterBuildTicks',
         'afterLayout',
         'beforeDatasetsUpdate',
         'beforeDatasetUpdate',
index ee70b2ea79ba02732d92609e84a75cc60e1b0cb8..67a3d4b93fd4ec5becd94335fa446df0472a2662 100644 (file)
@@ -31,21 +31,21 @@ describe('Chart.layouts', function() {
     });
 
     expect(chart.chartArea.bottom).toBeCloseToPixel(120);
-    expect(chart.chartArea.left).toBeCloseToPixel(34);
-    expect(chart.chartArea.right).toBeCloseToPixel(247);
+    expect(chart.chartArea.left).toBeCloseToPixel(31);
+    expect(chart.chartArea.right).toBeCloseToPixel(250);
     expect(chart.chartArea.top).toBeCloseToPixel(32);
 
     // Is xScale at the right spot
     expect(chart.scales.x.bottom).toBeCloseToPixel(150);
-    expect(chart.scales.x.left).toBeCloseToPixel(34);
-    expect(chart.scales.x.right).toBeCloseToPixel(247);
+    expect(chart.scales.x.left).toBeCloseToPixel(31);
+    expect(chart.scales.x.right).toBeCloseToPixel(250);
     expect(chart.scales.x.top).toBeCloseToPixel(120);
     expect(chart.scales.x.labelRotation).toBeCloseTo(0);
 
     // Is yScale at the right spot
     expect(chart.scales.y.bottom).toBeCloseToPixel(120);
     expect(chart.scales.y.left).toBeCloseToPixel(0);
-    expect(chart.scales.y.right).toBeCloseToPixel(34);
+    expect(chart.scales.y.right).toBeCloseToPixel(31);
     expect(chart.scales.y.top).toBeCloseToPixel(32);
     expect(chart.scales.y.labelRotation).toBeCloseTo(0);
   });
@@ -78,21 +78,21 @@ describe('Chart.layouts', function() {
       }
     });
 
-    expect(chart.chartArea.bottom).toBeCloseToPixel(142);
-    expect(chart.chartArea.left).toBeCloseToPixel(3);
-    expect(chart.chartArea.right).toBeCloseToPixel(216);
+    expect(chart.chartArea.bottom).toBeCloseToPixel(139);
+    expect(chart.chartArea.left).toBeCloseToPixel(0);
+    expect(chart.chartArea.right).toBeCloseToPixel(218);
     expect(chart.chartArea.top).toBeCloseToPixel(62);
 
     // Is xScale at the right spot
     expect(chart.scales.x.bottom).toBeCloseToPixel(62);
-    expect(chart.scales.x.left).toBeCloseToPixel(3);
-    expect(chart.scales.x.right).toBeCloseToPixel(216);
+    expect(chart.scales.x.left).toBeCloseToPixel(0);
+    expect(chart.scales.x.right).toBeCloseToPixel(218);
     expect(chart.scales.x.top).toBeCloseToPixel(32);
     expect(chart.scales.x.labelRotation).toBeCloseTo(0);
 
     // Is yScale at the right spot
-    expect(chart.scales.y.bottom).toBeCloseToPixel(142);
-    expect(chart.scales.y.left).toBeCloseToPixel(216);
+    expect(chart.scales.y.bottom).toBeCloseToPixel(139);
+    expect(chart.scales.y.left).toBeCloseToPixel(218);
     expect(chart.scales.y.right).toBeCloseToPixel(250);
     expect(chart.scales.y.top).toBeCloseToPixel(62);
     expect(chart.scales.y.labelRotation).toBeCloseTo(0);
@@ -158,28 +158,28 @@ describe('Chart.layouts', function() {
       }
     });
 
-    expect(chart.chartArea.bottom).toBeCloseToPixel(118);
-    expect(chart.chartArea.left).toBeCloseToPixel(73);
-    expect(chart.chartArea.right).toBeCloseToPixel(247);
+    expect(chart.chartArea.bottom).toBeCloseToPixel(110);
+    expect(chart.chartArea.left).toBeCloseToPixel(70);
+    expect(chart.chartArea.right).toBeCloseToPixel(250);
     expect(chart.chartArea.top).toBeCloseToPixel(32);
 
     // Is xScale at the right spot
     expect(chart.scales.x.bottom).toBeCloseToPixel(150);
-    expect(chart.scales.x.left).toBeCloseToPixel(73);
-    expect(chart.scales.x.right).toBeCloseToPixel(247);
-    expect(chart.scales.x.top).toBeCloseToPixel(118);
+    expect(chart.scales.x.left).toBeCloseToPixel(70);
+    expect(chart.scales.x.right).toBeCloseToPixel(250);
+    expect(chart.scales.x.top).toBeCloseToPixel(110);
     expect(chart.scales.x.labelRotation).toBeCloseTo(40, -1);
 
     // Are yScales at the right spot
-    expect(chart.scales.y.bottom).toBeCloseToPixel(118);
-    expect(chart.scales.y.left).toBeCloseToPixel(41);
-    expect(chart.scales.y.right).toBeCloseToPixel(73);
+    expect(chart.scales.y.bottom).toBeCloseToPixel(110);
+    expect(chart.scales.y.left).toBeCloseToPixel(38);
+    expect(chart.scales.y.right).toBeCloseToPixel(70);
     expect(chart.scales.y.top).toBeCloseToPixel(32);
     expect(chart.scales.y.labelRotation).toBeCloseTo(0);
 
-    expect(chart.scales.y2.bottom).toBeCloseToPixel(118);
+    expect(chart.scales.y2.bottom).toBeCloseToPixel(110);
     expect(chart.scales.y2.left).toBeCloseToPixel(0);
-    expect(chart.scales.y2.right).toBeCloseToPixel(41);
+    expect(chart.scales.y2.right).toBeCloseToPixel(38);
     expect(chart.scales.y2.top).toBeCloseToPixel(32);
     expect(chart.scales.y2.labelRotation).toBeCloseTo(0);
   });
@@ -217,13 +217,13 @@ describe('Chart.layouts', function() {
     });
 
     expect(chart.chartArea.bottom).toBeCloseToPixel(484);
-    expect(chart.chartArea.left).toBeCloseToPixel(40);
+    expect(chart.chartArea.left).toBeCloseToPixel(39);
     expect(chart.chartArea.right).toBeCloseToPixel(496);
     expect(chart.chartArea.top).toBeCloseToPixel(62);
 
     // Are xScales at the right spot
     expect(chart.scales.x.bottom).toBeCloseToPixel(512);
-    expect(chart.scales.x.left).toBeCloseToPixel(40);
+    expect(chart.scales.x.left).toBeCloseToPixel(39);
     expect(chart.scales.x.right).toBeCloseToPixel(496);
     expect(chart.scales.x.top).toBeCloseToPixel(484);
 
@@ -235,7 +235,7 @@ describe('Chart.layouts', function() {
     // Is yScale at the right spot
     expect(chart.scales.y.bottom).toBeCloseToPixel(484);
     expect(chart.scales.y.left).toBeCloseToPixel(0);
-    expect(chart.scales.y.right).toBeCloseToPixel(40);
+    expect(chart.scales.y.right).toBeCloseToPixel(39);
     expect(chart.scales.y.top).toBeCloseToPixel(62);
   });
 
@@ -565,7 +565,7 @@ describe('Chart.layouts', function() {
 
       // issue #4441: y-axis labels partially hidden.
       // minimum horizontal space required to fit labels
-      expect(yAxis.width).toBeCloseToPixel(33);
+      expect(yAxis.width).toBeCloseToPixel(30);
       expect(getLabels(yAxis)).toEqual(['0', '0.5', '1.0', '1.5', '2.0', '2.5']);
     });
   });
index 1ee7278b96bd1771b0b8199406ad79894938d17b..16b9699123e0f204676444bd76067e29db644ffa 100644 (file)
@@ -53,8 +53,8 @@ describe('Platform.basic', function() {
       expect(chart.platform).toBeInstanceOf(Chart.platforms.BasicPlatform);
 
       expect(chart.chartArea.bottom).toBeCloseToPixel(120);
-      expect(chart.chartArea.left).toBeCloseToPixel(34);
-      expect(chart.chartArea.right).toBeCloseToPixel(247);
+      expect(chart.chartArea.left).toBeCloseToPixel(31);
+      expect(chart.chartArea.right).toBeCloseToPixel(250);
       expect(chart.chartArea.top).toBeCloseToPixel(32);
     });
 
@@ -83,8 +83,8 @@ describe('Platform.basic', function() {
       chart.resize();
 
       expect(chart.chartArea.bottom).toBeCloseToPixel(150);
-      expect(chart.chartArea.left).toBeCloseToPixel(34);
-      expect(chart.chartArea.right).toBeCloseToPixel(297);
+      expect(chart.chartArea.left).toBeCloseToPixel(31);
+      expect(chart.chartArea.right).toBeCloseToPixel(300);
       expect(chart.chartArea.top).toBeCloseToPixel(32);
     });
   });
index 5fc3872e1a2391e534f61dfb5e80d43a1a229497..24bcf46b14b9312b04b652059ab1143895125c48 100644 (file)
@@ -279,7 +279,7 @@ describe('Category scale tests', function() {
     expect(yScale.getPixelForValue(0)).toBeCloseToPixel(32);
     expect(yScale.getValueForPixel(257)).toBe(2);
 
-    expect(yScale.getPixelForValue(4)).toBeCloseToPixel(481);
+    expect(yScale.getPixelForValue(4)).toBeCloseToPixel(484);
     expect(yScale.getValueForPixel(144)).toBe(1);
 
     yScale.options.offset = true;
@@ -288,7 +288,7 @@ describe('Category scale tests', function() {
     expect(yScale.getPixelForValue(0)).toBeCloseToPixel(77);
     expect(yScale.getValueForPixel(256)).toBe(2);
 
-    expect(yScale.getPixelForValue(4)).toBeCloseToPixel(436);
+    expect(yScale.getPixelForValue(4)).toBeCloseToPixel(438);
     expect(yScale.getValueForPixel(167)).toBe(1);
   });
 
@@ -402,7 +402,7 @@ describe('Category scale tests', function() {
 
     var yScale = chart.scales.y;
     expect(yScale.getPixelForValue(0)).toBeCloseToPixel(32);
-    expect(yScale.getPixelForValue(4)).toBeCloseToPixel(481);
+    expect(yScale.getPixelForValue(4)).toBeCloseToPixel(483);
   });
 
   it('Should get the correct pixel for an object value in a bar chart', function() {
@@ -437,8 +437,8 @@ describe('Category scale tests', function() {
 
     var xScale = chart.scales.x;
     expect(xScale.getPixelForValue(0)).toBeCloseToPixel(89);
-    expect(xScale.getPixelForValue(3)).toBeCloseToPixel(449);
-    expect(xScale.getPixelForValue(4)).toBeCloseToPixel(569);
+    expect(xScale.getPixelForValue(3)).toBeCloseToPixel(451);
+    expect(xScale.getPixelForValue(4)).toBeCloseToPixel(572);
   });
 
   it('Should get the correct pixel for an object value in a horizontal bar chart', function() {
index 364cbe76b39ca7458337c5b01be8d3c3b82d6bd3..9ed4641056da7f75cb33f2d8e0ce6314efb69588 100644 (file)
@@ -835,8 +835,8 @@ describe('Linear Scale', function() {
 
     var xScale = chart.scales.x;
     expect(xScale.getPixelForValue(1)).toBeCloseToPixel(501); // right - paddingRight
-    expect(xScale.getPixelForValue(-1)).toBeCloseToPixel(31 + 6); // left + paddingLeft + lineSpace
-    expect(xScale.getPixelForValue(0)).toBeCloseToPixel(266 + 6 / 2); // halfway*/
+    expect(xScale.getPixelForValue(-1)).toBeCloseToPixel(31 + 3); // left + paddingLeft + tick padding
+    expect(xScale.getPixelForValue(0)).toBeCloseToPixel(266 + 3 / 2); // halfway*/
 
     expect(xScale.getValueForPixel(501)).toBeCloseTo(1, 1e-2);
     expect(xScale.getValueForPixel(31)).toBeCloseTo(-1, 1e-2);
@@ -893,14 +893,14 @@ describe('Linear Scale', function() {
     expect(xScale.paddingBottom).toBeCloseToPixel(0);
     expect(xScale.paddingLeft).toBeCloseToPixel(12);
     expect(xScale.paddingRight).toBeCloseToPixel(13.5);
-    expect(xScale.width).toBeCloseToPixel(468 - 6); // minus lineSpace
+    expect(xScale.width).toBeCloseToPixel(468 - 3); // minus tick padding
     expect(xScale.height).toBeCloseToPixel(30);
 
-    expect(yScale.paddingTop).toBeCloseToPixel(7);
-    expect(yScale.paddingBottom).toBeCloseToPixel(7);
+    expect(yScale.paddingTop).toBeCloseToPixel(10);
+    expect(yScale.paddingBottom).toBeCloseToPixel(10);
     expect(yScale.paddingLeft).toBeCloseToPixel(0);
     expect(yScale.paddingRight).toBeCloseToPixel(0);
-    expect(yScale.width).toBeCloseToPixel(30 + 6); // plus lineSpace
+    expect(yScale.width).toBeCloseToPixel(31 + 3); // plus tick padding
     expect(yScale.height).toBeCloseToPixel(450);
 
     // Extra size when scale label showing
@@ -912,15 +912,15 @@ describe('Linear Scale', function() {
     expect(xScale.paddingBottom).toBeCloseToPixel(0);
     expect(xScale.paddingLeft).toBeCloseToPixel(12);
     expect(xScale.paddingRight).toBeCloseToPixel(13.5);
-    expect(xScale.width).toBeCloseToPixel(440);
-    expect(xScale.height).toBeCloseToPixel(53);
+    expect(xScale.width).toBeCloseToPixel(442);
+    expect(xScale.height).toBeCloseToPixel(50);
 
-    expect(yScale.paddingTop).toBeCloseToPixel(7);
-    expect(yScale.paddingBottom).toBeCloseToPixel(7);
+    expect(yScale.paddingTop).toBeCloseToPixel(10);
+    expect(yScale.paddingBottom).toBeCloseToPixel(10);
     expect(yScale.paddingLeft).toBeCloseToPixel(0);
     expect(yScale.paddingRight).toBeCloseToPixel(0);
     expect(yScale.width).toBeCloseToPixel(58);
-    expect(yScale.height).toBeCloseToPixel(427);
+    expect(yScale.height).toBeCloseToPixel(429);
   });
 
   it('should fit correctly when display is turned off', function() {
index 9309ffd2b2a8b8b80ab6435aa243ba11d2027d65..e9fccdf8faf584c4f673f4f00ff29cb37f6b2501 100644 (file)
@@ -1114,7 +1114,7 @@ describe('Time scale tests', function() {
     });
     const scale = chart.scales.x;
     expect(scale.getPixelForDecimal(0)).toBeCloseToPixel(29);
-    expect(scale.getPixelForDecimal(1.0)).toBeCloseToPixel(509);
+    expect(scale.getPixelForDecimal(1.0)).toBeCloseToPixel(512);
   });
 
   ['data', 'labels'].forEach(function(source) {