Description:
For Cartesian axes/subplots (for example, those containing scatter traces),
the reference documentation states that:
layer
Parent: layout.xaxis
Type: enumerated , one of ( "above traces" | "below traces" )
Default: "above traces"
Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with cliponaxis set to "false" to show markers and/or text nodes above this axis.
zerolinelayer
Parent: layout.xaxis
Type: enumerated , one of ( "above traces" | "below traces" )
Default: "below traces"
Sets the layer on which this zeroline is displayed. If "above traces", this zeroline is displayed above all the subplot's traces If "below traces", this zeroline is displayed below all the subplot's traces, but above the grid lines. Limitation: "zerolinelayer" currently has no effect if the "zorder" property is set on any trace.
However, this does not work for scattergl.
A WebGL marker remains visually above the zeroline (y = 0) even when:
yaxis: {
zerolinelayer: 'above traces'
}
is set.
Reproducible example:
https://codepen.io/Lexachoc/pen/xbqdWqm
https://codepen.io/Lexachoc/pen/EaWmLKY (line chart)
Relationship to cliponaxis:
This is separate from the feature request in #8074.
cliponaxis controls whether markers/text are clipped to the subplot's plotting area.
axis.layer / axis.zerolinelayer, on the other hand, control the stacking order of the axis / zeroline relative to traces.
Effect of axis.layer / axis.zerolinelayer: 'above traces':

Effect of axis.layer / axis.zerolinelayer: 'above traces' for line chart (the red line should not be seen):
Effect of cliponaxis: false:

Description:
For Cartesian axes/subplots (for example, those containing
scattertraces),the reference documentation states that:
layer
zerolinelayer
However, this does not work for
scattergl.A WebGL marker remains visually above the zeroline (
y = 0) even when:is set.
Reproducible example:
https://codepen.io/Lexachoc/pen/xbqdWqm
https://codepen.io/Lexachoc/pen/EaWmLKY (line chart)
Relationship to
cliponaxis:This is separate from the feature request in #8074.
cliponaxiscontrols whether markers/text are clipped to the subplot's plotting area.axis.layer/axis.zerolinelayer, on the other hand, control the stacking order of the axis / zeroline relative to traces.Effect of

axis.layer/axis.zerolinelayer:'above traces':Effect of
axis.layer/axis.zerolinelayer:'above traces'for line chart (the red line should not be seen):Effect of

cliponaxis: false: