Skip to content

Commit b851b4b

Browse files
etimbergEvert Timberg
authored andcommitted
Tests for the dataKey feature
1 parent cff8b13 commit b851b4b

File tree

10 files changed

+155
-0
lines changed

10 files changed

+155
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
config: {
3+
type: 'bar',
4+
data: {
5+
labels: [0, 1, 3, 4],
6+
datasets: [
7+
{
8+
data2: [5, 20, 10, 11],
9+
dataKey: 'data2',
10+
backgroundColor: '#00ff00',
11+
borderColor: '#ff0000',
12+
borderWidth: 2,
13+
}
14+
]
15+
},
16+
options: {
17+
scales: {
18+
x: {display: false},
19+
y: {display: false}
20+
}
21+
}
22+
},
23+
options: {
24+
canvas: {
25+
height: 256,
26+
width: 512
27+
}
28+
}
29+
};
6.05 KB
Loading
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
config: {
3+
type: 'doughnut',
4+
data: {
5+
labels: ['A', 'B', 'C', 'D', 'E'],
6+
datasets: [{
7+
data2: [1, 5, 10, 50, 100],
8+
dataKey: 'data2',
9+
backgroundColor: [
10+
'rgba(255, 99, 132, 0.8)',
11+
'rgba(54, 162, 235, 0.8)',
12+
'rgba(255, 206, 86, 0.8)',
13+
'rgba(75, 192, 192, 0.8)',
14+
'rgba(153, 102, 255, 0.8)'
15+
],
16+
borderWidth: 20,
17+
borderColor: [
18+
'rgb(255, 99, 132)',
19+
'rgb(54, 162, 235)',
20+
'rgb(255, 206, 86)',
21+
'rgb(75, 192, 192)',
22+
'rgb(153, 102, 255)'
23+
]
24+
}]
25+
},
26+
options: {
27+
responsive: false
28+
}
29+
}
30+
}
41 KB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
config: {
3+
type: 'line',
4+
data: {
5+
labels: [0, 1, 3, 4],
6+
datasets: [
7+
{
8+
data2: [5, 20, 10, 11],
9+
dataKey: 'data2',
10+
borderColor: '#ff0000',
11+
borderWidth: 2,
12+
fill: false,
13+
}
14+
]
15+
},
16+
options: {
17+
scales: {
18+
x: {display: false},
19+
y: {display: false}
20+
}
21+
}
22+
},
23+
options: {
24+
canvas: {
25+
height: 256,
26+
width: 512
27+
}
28+
}
29+
};
8.54 KB
Loading
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
config: {
3+
type: 'polarArea',
4+
data: {
5+
labels: ['A', 'B', 'C', 'D', 'E'],
6+
datasets: [{
7+
data2: [11, 16, 21, 1, 10],
8+
dataKey: 'data2',
9+
backgroundColor: [
10+
'rgba(255, 99, 132, 0.8)',
11+
'rgba(54, 162, 235, 0.8)',
12+
'rgba(255, 206, 86, 0.8)',
13+
'rgba(75, 192, 192, 0.8)',
14+
'rgba(153, 102, 255, 0.8)'
15+
],
16+
borderColor: [
17+
'rgb(255, 99, 132)',
18+
'rgb(54, 162, 235)',
19+
'rgb(255, 206, 86)',
20+
'rgb(75, 192, 192)',
21+
'rgb(153, 102, 255)'
22+
]
23+
}]
24+
},
25+
options: {
26+
elements: {
27+
arc: {
28+
angle: [
29+
2.1658, 10.8404, 21.6922, 108.4323, 216.8588
30+
]
31+
}
32+
},
33+
responsive: false,
34+
scale: {
35+
display: false
36+
}
37+
}
38+
}
39+
}
21 KB
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
config: {
3+
type: 'radar',
4+
data: {
5+
labels: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
6+
datasets: [{
7+
borderColor: 'red',
8+
data2: [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
9+
dataKey: 'data2',
10+
fill: false,
11+
}]
12+
},
13+
options: {
14+
responsive: false,
15+
scale: {
16+
display: false,
17+
min: 0,
18+
max: 3
19+
},
20+
}
21+
},
22+
options: {
23+
canvas: {
24+
height: 512,
25+
width: 512
26+
}
27+
}
28+
}
18.1 KB
Loading

0 commit comments

Comments
 (0)