Skip to content

Commit 7bac76a

Browse files
committed
fixed bar attributes
1 parent bc6652e commit 7bac76a

File tree

2 files changed

+165
-0
lines changed

2 files changed

+165
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"data": [
3+
{
4+
"type": "bar",
5+
"y": [1, 2, 1],
6+
"yaxis": "y2",
7+
"tooltiptemplate": "x: x: %{x}<br>y: %{y}",
8+
"tooltip": {"arrowcolor": "blue"}
9+
},
10+
{
11+
"type": "bar",
12+
"y": [2, 1, 2],
13+
"tooltiptemplate": "x: %{x}<br>y: %{y}",
14+
"tooltip": {"arrowcolor": "blue"}
15+
},
16+
{
17+
"type": "bar",
18+
"y": [1, 3, 0],
19+
"tooltiptemplate": "x: %{x}<br>y: %{y}",
20+
"tooltip": {"arrowcolor": "blue"}
21+
},
22+
{
23+
"type": "bar",
24+
"y": [1, 2, 1],
25+
"alignmentgroup": "top",
26+
"hovertext": "alignmentgroup: top",
27+
"xaxis": "x2",
28+
"yaxis": "y2",
29+
"tooltiptemplate": "x: %{x}<br>y: %{y}",
30+
"tooltip": {"arrowcolor": "blue"}
31+
},
32+
{
33+
"type": "bar",
34+
"y": [2, 1, 2],
35+
"hovertext": "alignmentgroup: top<br>offsetgroup: 1",
36+
"alignmentgroup": "bottom",
37+
"offsetgroup": "1",
38+
"xaxis": "x2",
39+
"tooltiptemplate": "x: %{x}<br>y: %{y}",
40+
"tooltip": {"arrowcolor": "blue"}
41+
},
42+
{
43+
"type": "bar",
44+
"y": [1, 3, 0],
45+
"hovertext": "alignmentgroup: top<br>offsetgroup: 2",
46+
"alignmentgroup": "bottom",
47+
"offsetgroup": "2",
48+
"xaxis": "x2",
49+
"tooltiptemplate": "x: %{x}<br>y: %{y}",
50+
"tooltip": {"arrowcolor": "blue"}
51+
}
52+
],
53+
"layout": {
54+
"showlegend": false,
55+
"grid": {
56+
"rows": 2,
57+
"columns": 2,
58+
"roworder": "bottom to top"
59+
},
60+
"colorway": ["blue", "orange", "green"],
61+
"margin": { "t": 20 },
62+
"xaxis": {
63+
"title": {
64+
"text": "no alignmentgroup<br>no offsetgroup"
65+
}
66+
},
67+
"xaxis2": {
68+
"title": {
69+
"text": "with alignmentgroup<br>with offsetgroup"
70+
}
71+
}
72+
},
73+
"config": {
74+
"editable": true,
75+
"modeBarButtonsToAdd": [
76+
"tooltip",
77+
"hoverclosest",
78+
"hovercompare",
79+
"togglespikelines"
80+
],
81+
"displaylogo": false,
82+
"displayModeBar": true
83+
}
84+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"data": [
3+
{
4+
"x": ["A", "B", "C", "D", "E", "F", "G"],
5+
"y": [null, null, null, null, 7, null, 6],
6+
"name": "AA",
7+
"type": "bar",
8+
"tooltiptemplate": "%{fullData.name}<br>%{x}<br>y: %{y}",
9+
"tooltip": {"arrowcolor": "blue"}
10+
},
11+
{
12+
"x": ["A", "B", "C", "D", "E", "F", "G"],
13+
"y": [8, null, null, null, null, null],
14+
"name": "BB",
15+
"type": "bar",
16+
"tooltiptemplate": "%{fullData.name}<br>%{x}<br>y: %{y}"
17+
},
18+
{
19+
"x": ["A", "B", "C", "D", "E", "F", "G"],
20+
"y": [null, null, null, 1, 3, null],
21+
"name": "CC",
22+
"type": "bar",
23+
"tooltiptemplate": "%{fullData.name}<br>%{x}<br>y: %{y}"
24+
},
25+
{
26+
"x": ["A", "B", "C", "D", "E", "F", "G"],
27+
"y": [null, 4, 4, null, null, null],
28+
"name": "DD",
29+
"type": "bar",
30+
"tooltiptemplate": "%{fullData.name}<br>%{x}<br>y: %{y}"
31+
},
32+
{
33+
"x": ["A", "B", "C", "D", "E", "F", "G"],
34+
"y": [null, null, null, 8, null, null, 3],
35+
"name": "EE",
36+
"type": "bar",
37+
"tooltiptemplate": "%{fullData.name}<br>%{x}<br>y: %{y}"
38+
},
39+
{
40+
"x": ["A", "B", "C", "D", "E", "F", "G"],
41+
"y": [null, null, null, 2, null, null],
42+
"name": "FF",
43+
"type": "bar",
44+
"tooltiptemplate": "%{fullData.name}<br>%{x}<br>y: %{y}"
45+
},
46+
{
47+
"x": ["A", "B", "C", "D", "E", "F", "G"],
48+
"y": [null, null, null, null, null, 1],
49+
"name": "GG",
50+
"type": "bar",
51+
"tooltiptemplate": "%{fullData.name}<br>%{x}<br>y: %{y}"
52+
}
53+
],
54+
"layout": {
55+
"xaxis": {
56+
"type": "category",
57+
"range": [-0.5, 6.5],
58+
"autorange": true
59+
},
60+
"barmode": "stack",
61+
"yaxis": {
62+
"type": "linear",
63+
"range": [0, 11.578947368421053],
64+
"autorange": true
65+
},
66+
"height": 450,
67+
"width": 1100,
68+
"autosize": true
69+
},
70+
"config": {
71+
"editable": true,
72+
"modeBarButtonsToAdd": [
73+
"tooltip",
74+
"hoverclosest",
75+
"hovercompare",
76+
"togglespikelines"
77+
],
78+
"displaylogo": false,
79+
"displayModeBar": true
80+
}
81+
}

0 commit comments

Comments
 (0)