Skip to content

Commit 261c2ed

Browse files
committed
add zeroline layer example
1 parent 83065e5 commit 261c2ed

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Zero Line Layer
3+
language: plotly_js
4+
suite: axes
5+
order: 12
6+
sitemap: false
7+
arrangement: horizontal
8+
markdown_content: |
9+
By default, zero lines are displayed below traces. Set `zerolinelayer="above traces"` on an axis to display its zero line above traces.
10+
---
11+
var trace1 = {
12+
x: ['A', 'B', 'C', 'D', 'A'],
13+
y: [2, 0, 4, -3, 2],
14+
fill: 'toself',
15+
mode: 'none',
16+
fillcolor: 'lightpink',
17+
type: 'scatter'
18+
};
19+
20+
var data = [trace1];
21+
22+
var layout = {
23+
yaxis: {
24+
zerolinelayer: "above traces" // Change to "below traces" to see the difference
25+
}
26+
};
27+
28+
Plotly.newPlot('myDiv', data, layout);

0 commit comments

Comments
 (0)