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

Skip to content

Commit 3e58fc2

Browse files
committed
Include labels with value >= 0
1 parent 445ada3 commit 3e58fc2

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

draftlogs/6051_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Discard negative values from pie chart post-aggregation instead of during summation [[#6051](https://github.com/plotly/plotly.js/pull/6051)]

src/traces/pie/calc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function calc(gd, trace) {
7676
}
7777

7878
// Drop aggregate sums of value 0 or less
79-
cd = cd.filter(function(elem) { return elem.v > 0; });
79+
cd = cd.filter(function(elem) { return elem.v >= 0; });
8080

8181
var shouldSort = (trace.type === 'funnelarea') ? isAggregated : trace.sort;
8282
if(shouldSort) cd.sort(function(a, b) { return b.v - a.v; });
18.1 KB
Loading

test/image/mocks/pie_negative_values.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,4 @@
3838
"height": 300,
3939
"width": 500
4040
}
41-
}
42-
41+
}

0 commit comments

Comments
 (0)