Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23e3972

Browse files
committed
Legend: add mocks with horizontal legends
* Added `legend_horizontal.json` (a mock with a horizontal legend without groups). * Added `legend_horizontal_groups.json` (a mock with a grouped horizontal legend).
1 parent e5049c9 commit 23e3972

File tree

4 files changed

+330
-0
lines changed

4 files changed

+330
-0
lines changed
22.8 KB
Loading
Loading
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
{
2+
"data": [
3+
{
4+
"x": [
5+
0,
6+
0.3571429,
7+
0.7142857,
8+
1.071429,
9+
1.428571,
10+
1.785714,
11+
2.142857,
12+
2.5,
13+
2.857143,
14+
3.214286,
15+
3.571429,
16+
3.928571,
17+
4.285714,
18+
4.642857,
19+
5
20+
],
21+
"y": [
22+
0.869693,
23+
1.088434,
24+
0.758308,
25+
1.849319,
26+
1.728616,
27+
0.9908515,
28+
1.519909,
29+
1.083975,
30+
0.3153477,
31+
0.04181056,
32+
-0.3400965,
33+
-0.1003989,
34+
-0.6768811,
35+
-0.8555722,
36+
-0.4287511
37+
],
38+
"name": "trace 0",
39+
"type": "scatter"
40+
},
41+
{
42+
"x": [
43+
0,
44+
1,
45+
2,
46+
3,
47+
4,
48+
5
49+
],
50+
"y": [
51+
1,
52+
0.5,
53+
0.7,
54+
-1.2,
55+
0.3,
56+
0.4
57+
],
58+
"name": "trace 1",
59+
"type": "bar"
60+
}
61+
],
62+
"layout": {
63+
"title": "Click to enter Plot title",
64+
"titlefont": {
65+
"color": "",
66+
"family": "",
67+
"size": 0
68+
},
69+
"font": {
70+
"family": "'Open sans', verdana, arial, sans-serif",
71+
"size": 12,
72+
"color": "#444"
73+
},
74+
"showlegend": true,
75+
"autosize": true,
76+
"width": 1152,
77+
"height": 481,
78+
"xaxis": {
79+
"title": "Click to enter X axis title",
80+
"titlefont": {
81+
"color": "",
82+
"family": "",
83+
"size": 0
84+
},
85+
"range": [
86+
-0.5,
87+
5.5
88+
],
89+
"domain": [
90+
0,
91+
1
92+
],
93+
"type": "linear",
94+
"rangemode": "normal",
95+
"showgrid": false,
96+
"zeroline": false,
97+
"showline": false,
98+
"autotick": true,
99+
"nticks": 0,
100+
"ticks": "",
101+
"showticklabels": true,
102+
"tick0": 0,
103+
"dtick": 1,
104+
"ticklen": 5,
105+
"tickwidth": 1,
106+
"tickcolor": "#444",
107+
"tickangle": "auto",
108+
"tickfont": {
109+
"family": "",
110+
"size": 0,
111+
"color": ""
112+
},
113+
"exponentformat": "B",
114+
"showexponent": "all",
115+
"gridcolor": "#eee",
116+
"gridwidth": 1,
117+
"zerolinecolor": "#444",
118+
"zerolinewidth": 1,
119+
"linecolor": "#444",
120+
"linewidth": 1,
121+
"anchor": "y",
122+
"position": 0,
123+
"mirror": false,
124+
"overlaying": false,
125+
"autorange": true
126+
},
127+
"yaxis": {
128+
"title": "Click to enter Y axis title",
129+
"titlefont": {
130+
"color": "",
131+
"family": "",
132+
"size": 0
133+
},
134+
"range": [
135+
-1.3694066111111112,
136+
2.018725611111111
137+
],
138+
"domain": [
139+
0,
140+
1
141+
],
142+
"type": "linear",
143+
"rangemode": "normal",
144+
"showgrid": true,
145+
"zeroline": true,
146+
"showline": false,
147+
"autotick": true,
148+
"nticks": 0,
149+
"ticks": "",
150+
"showticklabels": true,
151+
"tick0": 0,
152+
"dtick": 0.5,
153+
"ticklen": 5,
154+
"tickwidth": 1,
155+
"tickcolor": "#444",
156+
"tickangle": "auto",
157+
"tickfont": {
158+
"family": "",
159+
"size": 0,
160+
"color": ""
161+
},
162+
"exponentformat": "B",
163+
"showexponent": "all",
164+
"gridcolor": "#eee",
165+
"gridwidth": 1,
166+
"zerolinecolor": "#444",
167+
"zerolinewidth": 1,
168+
"linecolor": "#444",
169+
"linewidth": 1,
170+
"anchor": "x",
171+
"position": 0,
172+
"mirror": false,
173+
"overlaying": false,
174+
"autorange": true
175+
},
176+
"legend": {
177+
"orientation": "h",
178+
"x": 0,
179+
"xanchor": "left",
180+
"y": -0.1,
181+
"yanchor": "top",
182+
"traceorder": "normal",
183+
"font": {
184+
"family": "",
185+
"size": 0,
186+
"color": ""
187+
},
188+
"bgcolor": "#fff",
189+
"bordercolor": "#444",
190+
"borderwidth": 0
191+
},
192+
"margin": {
193+
"l": 80,
194+
"r": 80,
195+
"b": 80,
196+
"t": 100,
197+
"pad": 0,
198+
"autoexpand": true
199+
},
200+
"paper_bgcolor": "#fff",
201+
"plot_bgcolor": "#fff",
202+
"hovermode": "x",
203+
"dragmode": "zoom",
204+
"barmode": "group",
205+
"bargap": 0.2,
206+
"bargroupgap": 0,
207+
"boxmode": "overlay",
208+
"separators": ".,",
209+
"hidesources": false
210+
}
211+
}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"data": [
3+
{
4+
"type": "scatter",
5+
"x": [
6+
1,
7+
2,
8+
3
9+
],
10+
"y": [
11+
2,
12+
1,
13+
2
14+
],
15+
"legendgroup": "group"
16+
},
17+
{
18+
"type": "box",
19+
"x": [
20+
1,
21+
2,
22+
3
23+
],
24+
"y": [
25+
1,
26+
2,
27+
1
28+
],
29+
"legendgroup": "group",
30+
"showlegend": false
31+
},
32+
{
33+
"type": "bar",
34+
"x": [
35+
1,
36+
2,
37+
3
38+
],
39+
"y": [
40+
2,
41+
1,
42+
2
43+
],
44+
"legendgroup": "group 2"
45+
},
46+
{
47+
"type": "scatter",
48+
"x": [
49+
3,
50+
4,
51+
5
52+
],
53+
"y": [
54+
2,
55+
1,
56+
2
57+
],
58+
"legendgroup": "group"
59+
},
60+
{
61+
"type": "scatter",
62+
"x": [
63+
3,
64+
4,
65+
5
66+
],
67+
"y": [
68+
1,
69+
2,
70+
1
71+
]
72+
},
73+
{
74+
"type": "bar",
75+
"x": [
76+
3,
77+
4,
78+
5
79+
],
80+
"y": [
81+
2,
82+
1,
83+
2
84+
],
85+
"legendgroup": "group 2",
86+
"showlegend": false
87+
}
88+
],
89+
"layout": {
90+
"legend": {
91+
"x": 0,
92+
"xanchor": "left",
93+
"y": -0.1,
94+
"yanchor": "top",
95+
"orientation": "h",
96+
"tracegroupgap": 20
97+
},
98+
"xaxis": {
99+
"type": "linear",
100+
"range": [
101+
0.5,
102+
5.5
103+
],
104+
"autorange": true
105+
},
106+
"yaxis": {
107+
"type": "linear",
108+
"range": [
109+
0,
110+
2.136498516320475
111+
],
112+
"autorange": true
113+
},
114+
"height": 450,
115+
"width": 1000,
116+
"autosize": true,
117+
"showlegend": true
118+
}
119+
}

0 commit comments

Comments
 (0)