mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Fix labelOffset not working for vertical axes (#4249)
This commit is contained in:
parent
f16d8a32e2
commit
b03ab1ca45
@ -647,7 +647,7 @@ module.exports = function(Chart) {
|
|||||||
|
|
||||||
var yLineValue = me.getPixelForTick(index); // xvalues for grid lines
|
var yLineValue = me.getPixelForTick(index); // xvalues for grid lines
|
||||||
yLineValue += helpers.aliasPixel(lineWidth);
|
yLineValue += helpers.aliasPixel(lineWidth);
|
||||||
labelY = me.getPixelForTick(index, gridLines.offsetGridLines);
|
labelY = me.getPixelForTick(index, gridLines.offsetGridLines) + optionTicks.labelOffset;
|
||||||
|
|
||||||
tx1 = xTickStart;
|
tx1 = xTickStart;
|
||||||
tx2 = xTickEnd;
|
tx2 = xTickEnd;
|
||||||
|
41
test/fixtures/core.scale/label-offset-vertical-axes.json
vendored
Normal file
41
test/fixtures/core.scale/label-offset-vertical-axes.json
vendored
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
test/fixtures/core.scale/label-offset-vertical-axes.png
vendored
Normal file
BIN
test/fixtures/core.scale/label-offset-vertical-axes.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
3
test/specs/core.scale.tests.js
Normal file
3
test/specs/core.scale.tests.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
describe('Core.scale', function() {
|
||||||
|
describe('auto', jasmine.specsFromFixtures('core.scale'));
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user