Fix labelOffset not working for vertical axes (#4249)

This commit is contained in:
Suhaib Khan 2017-07-15 13:49:16 +05:30 committed by Simon Brunel
parent f16d8a32e2
commit b03ab1ca45
4 changed files with 45 additions and 1 deletions

View File

@ -647,7 +647,7 @@ module.exports = function(Chart) {
var yLineValue = me.getPixelForTick(index); // xvalues for grid lines
yLineValue += helpers.aliasPixel(lineWidth);
labelY = me.getPixelForTick(index, gridLines.offsetGridLines);
labelY = me.getPixelForTick(index, gridLines.offsetGridLines) + optionTicks.labelOffset;
tx1 = xTickStart;
tx2 = xTickEnd;

View File

@ -0,0 +1,41 @@
{
"config": {
"type": "horizontalBar",
"data": {
"labels": ["\u25C0", "\u25A0", "\u25C6", "\u25CF"],
"datasets": [{
"data": [12, 19, 3, 5]
}]
},
"options": {
"legend": false,
"title": false,
"scales": {
"xAxes": [{
"ticks": {
"display": false
},
"gridLines":{
"display": false,
"drawBorder": false
}
}],
"yAxes": [{
"ticks": {
"labelOffset": 25
},
"gridLines":{
"display": false,
"drawBorder": false
}
}]
}
}
},
"options": {
"canvas": {
"height": 256,
"width": 512
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -0,0 +1,3 @@
describe('Core.scale', function() {
describe('auto', jasmine.specsFromFixtures('core.scale'));
});