mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
lower default value of grid z index so it draws behind chart elements (#9426)
This commit is contained in:
parent
0094a58ef1
commit
259f8e8471
@ -1620,7 +1620,7 @@ export default class Scale extends Element {
|
|||||||
const me = this;
|
const me = this;
|
||||||
const opts = me.options;
|
const opts = me.options;
|
||||||
const tz = opts.ticks && opts.ticks.z || 0;
|
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) {
|
if (!me._isVisible() || me.draw !== Scale.prototype.draw) {
|
||||||
// backward compatibility: draw has been overridden by custom scale
|
// backward compatibility: draw has been overridden by custom scale
|
||||||
|
|||||||
49
test/fixtures/core.scale/border-behind-elements.js
vendored
Normal file
49
test/fixtures/core.scale/border-behind-elements.js
vendored
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
BIN
test/fixtures/core.scale/border-behind-elements.png
vendored
Normal file
BIN
test/fixtures/core.scale/border-behind-elements.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Loading…
x
Reference in New Issue
Block a user