Fix ticks.mirror (#8482)

This commit is contained in:
Jukka Kurkela 2021-02-21 21:27:14 +02:00 committed by GitHub
parent aa69892823
commit 5285735c0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 2 deletions

View File

@ -1524,6 +1524,11 @@ export default class Scale extends Element {
*/
_computeLabelArea() {
const me = this;
if (me.options.ticks.mirror) {
return;
}
const chart = me.chart;
const position = me.options.position;
@ -1532,8 +1537,6 @@ export default class Scale extends Element {
} if (position === 'top' || position === 'bottom') {
return {top: me.top, left: 0, bottom: me.bottom, right: chart.width};
}
return null;
}
/**

View File

@ -0,0 +1,27 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [{
data: [1, -1, 3],
}],
labels: ['Label1', 'Label2', 'Label3']
},
options: {
scales: {
y: {
ticks: {
mirror: true
}
}
}
}
},
options: {
spriteText: true,
canvas: {
height: 256,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB