Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #4704: Bumpy line on smooth data set. #4944

Merged
merged 1 commit into from
Nov 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/scales/scale.linear.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,10 @@ module.exports = function(Chart) {

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;
Expand Down
4 changes: 2 additions & 2 deletions test/specs/core.controller.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,8 @@ describe('Chart', function() {

// 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);

Expand Down
2 changes: 1 addition & 1 deletion test/specs/core.tooltip.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ describe('Core.Tooltip', function() {

it('Should not update if active element has not changed', function() {
var chart = window.acquireChart({
type: 'bar',
type: 'line',
data: {
datasets: [{
label: 'Dataset 1',
Expand Down