lower default value of grid z index so it draws behind chart elements (#9426)

This commit is contained in:
Jacco van den Berg 2021-07-16 17:16:31 +02:00 committed by GitHub
parent 0094a58ef1
commit 259f8e8471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 1 deletions

View File

@ -1620,7 +1620,7 @@ export default class Scale extends Element {
const me = this;
const opts = me.options;
const tz = opts.ticks && opts.ticks.z || 0;
const gz = opts.grid && opts.grid.z || 0;
const gz = valueOrDefault(opts.grid && opts.grid.z, -1);
if (!me._isVisible() || me.draw !== Scale.prototype.draw) {
// backward compatibility: draw has been overridden by custom scale

View File

@ -0,0 +1,49 @@
module.exports = {
config: {
type: 'bubble',
data: {
datasets: [
{
label: '# of Votes',
data: [{x: 19, y: 3, r: 3}, {x: 2, y: 2, r: 60}],
radius: 100,
backgroundColor: 'pink'
}
]
},
options: {
plugins: {
legend: {
display: false
}
},
scales: {
y: {
ticks: {
display: false
},
grid: {
borderColor: 'red',
borderWidth: 5
}
},
x: {
ticks: {
display: false
},
grid: {
borderColor: 'red',
borderWidth: 5
}
}
}
}
},
options: {
canvas: {
height: 512,
width: 512
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB