Skip to content

Commit

Permalink
lower default value of grid z index so it draws behind chart elements (
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeLenaleee committed Jul 16, 2021
1 parent 0094a58 commit 259f8e8
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/core.scale.js
Expand Up @@ -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
Expand Down
49 changes: 49 additions & 0 deletions test/fixtures/core.scale/border-behind-elements.js
@@ -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
}
}
};
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 259f8e8

Please sign in to comment.