Skip to content

Commit 1c31675

Browse files
committed
add simple multicat example in js
1 parent 4538bfc commit 1c31675

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Multi-Category Axes
3+
plot_url: https://codepen.io/plotly/embed/bOByWR/?height=456&theme-id=15263&default-tab=result
4+
language: plotly_js
5+
suite: axes
6+
order: 7.4
7+
sitemap: false
8+
arrangement: horizontal
9+
---
10+
11+
var trace1 = {
12+
x: [
13+
['SF Zoo','SF Zoo','SF Zoo'],
14+
['giraffes', 'orangutans', 'monkeys']
15+
],
16+
y: [20, 14, 23],
17+
name: 'SF Zoo',
18+
type: 'bar'
19+
};
20+
21+
var trace2 = {
22+
x: [
23+
['LA Zoo','LA Zoo','LA Zoo'],
24+
['giraffes', 'orangutans', 'monkeys']
25+
],
26+
y: [12, 18, 29],
27+
name: 'LA Zoo',
28+
type: 'bar'
29+
};
30+
31+
var data = [trace1, trace2];
32+
var layout = {
33+
showlegend: false,
34+
xaxis: {
35+
tickson: "boundaries",
36+
ticklen: 15,
37+
showdividers: true,
38+
dividercolor: 'grey',
39+
dividerwidth: 2
40+
}
41+
};
42+
43+
Plotly.newPlot('myDiv', data, layout);

0 commit comments

Comments
 (0)