We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ba0249 commit ee1f8c4Copy full SHA for ee1f8c4
test/jasmine/tests/pie_test.js
@@ -65,6 +65,33 @@ describe('Pie traces:', function() {
65
.catch(failTest)
66
.then(done);
67
});
68
+
69
+ it('can sum values or count labels', function(done) {
70
+ Plotly.newPlot(gd, [{
71
+ labels: ['a', 'b', 'c', 'a', 'b', 'a'],
72
+ values: [1, 2, 3, 4, 5, 6],
73
+ type: 'pie',
74
+ domain: {x: [0, 0.45]}
75
+ }, {
76
+ labels: ['d', 'e', 'f', 'd', 'e', 'd'],
77
78
+ domain: {x: [0.55, 1]}
79
+ }])
80
+ .then(function() {
81
+ var expected = [
82
+ [['a', 11], ['b', 7], ['c', 3]],
83
+ [['d', 3], ['e', 2], ['f', 1]]
84
+ ];
85
+ for(var i = 0; i < 2; i++) {
86
+ for(var j = 0; j < 3; j++) {
87
+ expect(gd.calcdata[i][j].label).toBe(expected[i][j][0], i + ',' + j);
88
+ expect(gd.calcdata[i][j].v).toBe(expected[i][j][1], i + ',' + j);
89
+ }
90
91
+ })
92
+ .catch(failTest)
93
+ .then(done);
94
+ });
95
96
97
describe('pie hovering', function() {
0 commit comments