}
}
-
this.ctx.translate(xLabelValue, yLabelValue);
this.ctx.rotate(helpers.toRadians(this.labelRotation) * -1);
this.ctx.font = labelFont;
this.ctx.restore();
}
}
+
+ // Draw the line at the edge of the axis
+ this.ctx.lineWidth = this.options.gridLines.lineWidth;
+ this.ctx.strokeStyle = this.options.gridLines.color;
+ var x1 = this.left, x2 = this.right, y1 = this.top, y2 = this.bottom;
+
+ if (this.isHorizontal()) {
+ y1 = y2 = this.options.position === 'top' ? this.bottom : this.top;
+ } else {
+ x1 = x2 = this.options.position === 'left' ? this.right : this.left;
+ }
+
+ this.ctx.moveTo(x1, y1);
+ this.ctx.lineTo(x2, y2);
+ this.ctx.stroke();
}
}
});
}, {
"name": "restore",
"args": []
+ }, {
+ "name": "setLineWidth",
+ "args": [1]
+ }, {
+ "name": "setStrokeStyle",
+ "args": ["rgba(0, 0, 0, 0.1)"]
+ }, {
+ "name": "moveTo",
+ "args": [0, 100]
+ }, {
+ "name": "lineTo",
+ "args": [200, 100]
+ }, {
+ "name": "stroke",
+ "args": []
}];
expect(mockContext.getCalls()).toEqual(expected);
}, {
"name": "fillText",
"args": ["myLabel", 100, 122]
+ }, {
+ "name": "setLineWidth",
+ "args": [1]
+ }, {
+ "name": "setStrokeStyle",
+ "args": ["rgba(0, 0, 0, 0.1)"]
+ }, {
+ "name": "moveTo",
+ "args": [0, 100]
+ }, {
+ "name": "lineTo",
+ "args": [200, 100]
+ }, {
+ "name": "stroke",
+ "args": []
}]);
// Turn off display
}, {
"name": "restore",
"args": []
+ }, {
+ "name": "setLineWidth",
+ "args": [1]
+ }, {
+ "name": "setStrokeStyle",
+ "args": ["rgba(0, 0, 0, 0.1)"]
+ }, {
+ "name": "moveTo",
+ "args": [30, 0]
+ }, {
+ "name": "lineTo",
+ "args": [30, 300]
+ }, {
+ "name": "stroke",
+ "args": []
}]);
// Turn off some drawing
}, {
"name": "restore",
"args": []
+ }, {
+ "name": "setLineWidth",
+ "args": [1]
+ }, {
+ "name": "setStrokeStyle",
+ "args": ["rgba(0, 0, 0, 0.1)"]
+ }, {
+ "name": "moveTo",
+ "args": [30, 0]
+ }, {
+ "name": "lineTo",
+ "args": [30, 300]
+ }, {
+ "name": "stroke",
+ "args": []
}]);
});
}, {
"name": "restore",
"args": []
+ }, {
+ "name": "setLineWidth",
+ "args": [1]
+ }, {
+ "name": "setStrokeStyle",
+ "args": ["rgba(0, 0, 0, 0.1)"]
+ }, {
+ "name": "moveTo",
+ "args": [30, 0]
+ }, {
+ "name": "lineTo",
+ "args": [30, 300]
+ }, {
+ "name": "stroke",
+ "args": []
}])
});
});
\ No newline at end of file