8000 sort categories by value: fix for box and ohlc · maun/plotly.js@677374d · GitHub
[go: up one dir, main page]

Skip to content < 8000 /span>

Commit 677374d

Browse files
committed
sort categories by value: fix for box and ohlc
1 parent 04e68c3 commit 677374d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/traces/box/calc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ module.exports = function calc(gd, trace) {
8080
cdi.pos = posDistinct[i];
8181
cdi.pts = pts;
8282

83+
cdi.x = cdi.pos;
84+
cdi.y = cdi.pts.map(function(pt) { return pt.v; });
85+
8386
cdi.min = boxVals[0];
8487
cdi.max = boxVals[bvLen - 1];
8588
cdi.mean = Lib.mean(boxVals, bvLen);

src/traces/ohlc/calc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ function calcCommon(gd, trace, x, ya, ptFunc) {
8686
pt.i = i;
8787
pt.dir = increasing ? 'increasing' : 'decreasing';
8888

89+
// For categoryorder, store low and high
90+
pt.x = pt.pos;
91+
pt.y = [li, hi];
92+
8993
if(hasTextArray) pt.tx = trace.text[i];
9094
if(hasHovertextArray) pt.htx = trace.hovertext[i];
9195

0 commit comments

Comments
 (0)
0