Skip to content

Commit 2e966e0

Browse files
committed
pie & sunburst: pass empty text string to texttemplate
1 parent 9b4a38d commit 2e966e0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/traces/pie/plot.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,8 @@ function formatSliceLabel(gd, pt, cd0) {
991991
pt.text = '';
992992
} else {
993993
var obj = makeTemplateVariables(pt);
994-
var ptTx = helpers.getFirstFilled(trace.text, pt.pts);
995-
if(isValidTextValue(ptTx)) obj.text = ptTx;
994+
var ptTx = Lib.castOption(trace, pt.i, 'text');
995+
if(isValidTextValue(ptTx) || ptTx === '') obj.text = ptTx;
996996
pt.text = Lib.texttemplateString(txt, obj, gd._fullLayout._d3locale, obj, trace._meta || {});
997997
}
998998
}

Diff for: src/traces/sunburst/plot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ function formatSliceLabel(pt, trace, fullLayout) {
718718
obj.color = cdi.color;
719719
}
720720
var ptTx = Lib.castOption(trace, cdi.i, 'text');
721-
if(Lib.isValidTextValue(ptTx)) obj.text = ptTx;
721+
if(Lib.isValidTextValue(ptTx) || ptTx === '') obj.text = ptTx;
722722
obj.customdata = Lib.castOption(trace, cdi.i, 'customdata');
723723
return Lib.texttemplateString(txt, obj, fullLayout._d3locale, obj, trace._meta || {});
724724
}

0 commit comments

Comments
 (0)