var innerDimension = horz ? me.width - (me.paddingLeft + me.paddingRight) : me.height - (me.paddingTop + me.paddingBottom);
var valueDimension = innerDimension / offsetAmt;
+ pixel -= horz ? me.left : me.top;
+
if (me.options.gridLines.offsetGridLines) {
pixel -= (valueDimension / 2);
}
expect(scale.getPixelForValue(0, 4, 0, false)).toBe(452);
expect(scale.getPixelForValue(0, 4, 0, true)).toBe(505);
- expect(scale.getValueForPixel(452)).toBe(4);
+ expect(scale.getValueForPixel(453)).toBe(4);
expect(scale.getValueForPixel(505)).toBe(4);
config.gridLines.offsetGridLines = false;
expect(scale.getPixelForValue(0, 4, 0, false)).toBe(161);
expect(scale.getPixelForValue(0, 4, 0, true)).toBe(180);
- expect(scale.getValueForPixel(161)).toBe(4);
+ expect(scale.getValueForPixel(162)).toBe(4);
config.gridLines.offsetGridLines = false;