Skip to content

Commit 0de668b

Browse files
kurkleetimberg
authored andcommitted
Fix line / non-numeric-y (#6617)
1 parent d4dc505 commit 0de668b

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

Diff for: src/controllers/controller.line.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ module.exports = DatasetController.extend({
209209
if (rightValue < 0) {
210210
return yScale.getPixelForValue(sumNeg + rightValue);
211211
}
212+
return yScale.getPixelForValue(sumPos + rightValue);
212213
}
213-
return yScale.getPixelForValue(sumPos + rightValue);
214+
return yScale.getPixelForValue(value);
214215
},
215216

216217
updateBezierControlPoints: function() {

Diff for: test/fixtures/controller.line/non-numeric-y.json

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"config": {
3+
"type": "line",
4+
"data": {
5+
"xLabels": ["January", "February", "March", "April", "May", "June", "July"],
6+
"yLabels": ["", "Request Added", "Request Viewed", "Request Accepted", "Request Solved", "Solving Confirmed"],
7+
"datasets": [{
8+
"label": "My First dataset",
9+
"data": ["", "Request Added", "Request Added", "Request Added", "Request Viewed", "Request Viewed", "Request Viewed"],
10+
"fill": false,
11+
"borderColor": "red",
12+
"backgroundColor": "red"
13+
}]
14+
},
15+
"options": {
16+
"responsive": false,
17+
"legend": false,
18+
"title": false,
19+
"scales": {
20+
"xAxes": [{"display": false}],
21+
"yAxes": [{
22+
"type": "category",
23+
"display": false
24+
}]
25+
}
26+
}
27+
},
28+
"options": {
29+
"canvas": {
30+
"height": 256,
31+
"width": 512
32+
}
33+
}
34+
}

Diff for: test/fixtures/controller.line/non-numeric-y.png

3.62 KB
Loading

0 commit comments

Comments
 (0)