Skip to content

Commit f88fdb5

Browse files
committed
test(plugin.legend): add tests for legend navigation
1 parent 70804c8 commit f88fdb5

File tree

41 files changed

+2017
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2017
-2
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"config": {
3+
"type": "doughnut",
4+
"data": {
5+
"labels": ["", ["", "", ""], "", "", "", "", "", "", "", "", "", ""],
6+
"datasets": [
7+
{
8+
"data": [10, 20, 30, 40, 50, 60, 70, 10, 20, 30, 40, 50],
9+
"backgroundColor": "#00ff00",
10+
"borderWidth": 0
11+
}
12+
]
13+
},
14+
"options": {
15+
"plugins": {
16+
"legend": {
17+
"position": "top",
18+
"align": "center"
19+
}
20+
}
21+
}
22+
},
23+
"options": {
24+
"canvas": {
25+
"height": 256,
26+
"width": 512
27+
}
28+
}
29+
}
10.5 KB
Loading
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"config": {
3+
"type": "doughnut",
4+
"data": {
5+
"labels": ["Label 1", "Label 2", "Label 3", "Label 4", "Label 5"],
6+
"datasets": [
7+
{
8+
"data": [10, 20, 30, 40, 50],
9+
"backgroundColor": "#00ff00",
10+
"borderWidth": 0
11+
}
12+
]
13+
},
14+
"options": {
15+
"plugins": {
16+
"legend": {
17+
"position": "top",
18+
"align": "start",
19+
"navigation": {
20+
"display": "auto",
21+
"maxRows": 1
22+
}
23+
}
24+
}
25+
}
26+
},
27+
"options": {
28+
"canvas": {
29+
"height": 256,
30+
"width": 512
31+
}
32+
}
33+
}
13.3 KB
Loading
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"config": {
3+
"type": "doughnut",
4+
"data": {
5+
"labels": [
6+
"Label 1",
7+
"Label 2",
8+
"Label 3",
9+
"Label 4",
10+
"Label 5",
11+
"Label 6",
12+
"Label 7",
13+
"Label 8",
14+
"Label 9",
15+
"Label 10"
16+
],
17+
"datasets": [
18+
{
19+
"data": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
20+
"backgroundColor": "#00ff00",
21+
"borderWidth": 0
22+
}
23+
]
24+
},
25+
"options": {
26+
"plugins": {
27+
"legend": {
28+
"position": "top",
29+
"align": "start",
30+
"navigation": {
31+
"display": "auto",
32+
"maxRows": 1
33+
}
34+
}
35+
}
36+
}
37+
},
38+
"options": {
39+
"canvas": {
40+
"height": 256,
41+
"width": 512
42+
}
43+
}
44+
}
13 KB
Loading
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"config": {
3+
"type": "doughnut",
4+
"data": {
5+
"labels": [
6+
"Label 1",
7+
["Label 2", "Second line"],
8+
"Label 3",
9+
"Label 4",
10+
"Label 5",
11+
"Label 6",
12+
"Label 7",
13+
"Label 8",
14+
"Label 9",
15+
"Label 10",
16+
"Label 11",
17+
"Label 12",
18+
"Label 13",
19+
"Label 14",
20+
"Label 15"
21+
],
22+
"datasets": [
23+
{
24+
"data": [
25+
10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150
26+
],
27+
"backgroundColor": "#00ff00",
28+
"borderWidth": 0
29+
}
30+
]
31+
},
32+
"options": {
33+
"plugins": {
34+
"legend": {
35+
"position": "top",
36+
"align": "start",
37+
"maxHeight": 300,
38+
"navigation": {
39+
"display": true,
40+
"maxRows": 2,
41+
"grid": {
42+
"x": true
43+
}
44+
}
45+
}
46+
}
47+
}
48+
},
49+
"options": {
50+
"canvas": {
51+
"height": 256,
52+
"width": 512
53+
}
54+
}
55+
}
16.7 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"config": {
3+
"type": "doughnut",
4+
"data": {
5+
"labels": ["Label 1", "Label 2", "Label 3"],
6+
"datasets": [
7+
{
8+
"data": [10, 20, 30],
9+
"backgroundColor": "#00ff00",
10+
"borderWidth": 0
11+
}
12+
]
13+
},
14+
"options": {
15+
"plugins": {
16+
"legend": {
17+
"position": "top",
18+
"align": "center",
19+
"navigation": {
20+
"display": true,
21+
"maxRows": 1,
22+
"align": "center"
23+
}
24+
}
25+
}
26+
}
27+
},
28+
"options": {
29+
"canvas": {
30+
"height": 256,
31+
"width": 512
32+
}
33+
}
34+
}
11.4 KB
Loading

0 commit comments

Comments
 (0)