Skip to content

Commit 8118644

Browse files
committed
provide delta, initial and final for totals of waterfall
1 parent 5342fe4 commit 8118644

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/traces/waterfall/hover.js

+8-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, opts) {
3131

3232
var size = (di.isSum) ? di.b + di.s : di.rawS;
3333

34-
if(!di.isSum) {
35-
point.initial = di.b + di.s - size;
36-
point.delta = size;
37-
point.final = point.initial + point.delta;
38-
39-
var v = formatNumber(Math.abs(point.delta));
40-
point.deltaLabel = size < 0 ? '(' + v + ')' : v;
41-
point.finalLabel = formatNumber(point.final);
42-
point.initialLabel = formatNumber(point.initial);
43-
}
34+
point.initial = di.b + di.s - size;
35+
point.delta = size;
36+
point.final = point.initial + point.delta;
37+
38+
var v = formatNumber(Math.abs(point.delta));
39+
point.deltaLabel = size < 0 ? '(' + v + ')' : v;
40+
point.finalLabel = formatNumber(point.final);
41+
point.initialLabel = formatNumber(point.initial);
4442

4543
var hoverinfo = di.hi || trace.hoverinfo;
4644
var text = [];

0 commit comments

Comments
 (0)