Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b9ea827

Browse files
[Bars] Force text to be inside if total is to be displayed
Contributes to #85
1 parent 1fd9cee commit b9ea827

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/traces/bar/plot.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ function appendBarText(gd, plotinfo, bar, cd, i, x0, x1, y0, y1, opts, makeOnCom
298298
var isHorizontal = (trace.orientation === 'h');
299299

300300
var text = getText(fullLayout, cd, i, xa, ya);
301-
textPosition = getTextPosition(trace, i);
301+
textPosition = getTextPosition(trace, i,fullLayout.displaytotal);
302302

303303
// compute text position
304304
var inStackOrRelativeMode =
@@ -673,7 +673,8 @@ function getText(fullLayout, cd, index, xa, ya) {
673673
return helpers.coerceString(attributeText, value);
674674
}
675675

676-
function getTextPosition(trace, index) {
676+
function getTextPosition(trace, index, forceInside) {
677+
if(forceInside) return 'inside';
677678
var value = helpers.getValue(trace.textposition, index);
678679
return helpers.coerceEnumerated(attributeTextPosition, value);
679680
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /