diff --git a/src/controllers/controller.line.js b/src/controllers/controller.line.js index dc1fc689b24..47adc08010c 100644 --- a/src/controllers/controller.line.js +++ b/src/controllers/controller.line.js @@ -209,8 +209,9 @@ module.exports = DatasetController.extend({ if (rightValue < 0) { return yScale.getPixelForValue(sumNeg + rightValue); } + return yScale.getPixelForValue(sumPos + rightValue); } - return yScale.getPixelForValue(sumPos + rightValue); + return yScale.getPixelForValue(value); }, updateBezierControlPoints: function() { diff --git a/test/fixtures/controller.line/non-numeric-y.json b/test/fixtures/controller.line/non-numeric-y.json new file mode 100644 index 00000000000..db5f3c38180 --- /dev/null +++ b/test/fixtures/controller.line/non-numeric-y.json @@ -0,0 +1,34 @@ +{ + "config": { + "type": "line", + "data": { + "xLabels": ["January", "February", "March", "April", "May", "June", "July"], + "yLabels": ["", "Request Added", "Request Viewed", "Request Accepted", "Request Solved", "Solving Confirmed"], + "datasets": [{ + "label": "My First dataset", + "data": ["", "Request Added", "Request Added", "Request Added", "Request Viewed", "Request Viewed", "Request Viewed"], + "fill": false, + "borderColor": "red", + "backgroundColor": "red" + }] + }, + "options": { + "responsive": false, + "legend": false, + "title": false, + "scales": { + "xAxes": [{"display": false}], + "yAxes": [{ + "type": "category", + "display": false + }] + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} diff --git a/test/fixtures/controller.line/non-numeric-y.png b/test/fixtures/controller.line/non-numeric-y.png new file mode 100644 index 00000000000..5ebecd597b5 Binary files /dev/null and b/test/fixtures/controller.line/non-numeric-y.png differ