Linear scale getPixelForValue() method doesn't round the returned value anymore.
if (me.isHorizontal()) {
pixel = me.left + (me.width / range * (rightValue - start));
- return Math.round(pixel);
+ } else {
+ pixel = me.bottom - (me.height / range * (rightValue - start));
}
-
- pixel = me.bottom - (me.height / range * (rightValue - start));
- return Math.round(pixel);
+ return pixel;
},
getValueForPixel: function(pixel) {
var me = this;
// Verify that points are at their initial correct location,
// then we will reset and see that they moved
- expect(meta.data[0]._model.y).toBe(333);
- expect(meta.data[1]._model.y).toBe(183);
+ expect(meta.data[0]._model.y).toBeCloseToPixel(333);
+ expect(meta.data[1]._model.y).toBeCloseToPixel(183);
expect(meta.data[2]._model.y).toBe(32);
expect(meta.data[3]._model.y).toBe(484);
it('Should not update if active element has not changed', function() {
var chart = window.acquireChart({
- type: 'bar',
+ type: 'line',
data: {
datasets: [{
label: 'Dataset 1',