Skip to content

Commit 3df1f9c

Browse files
committed
revise labelalias to run after prefix & suffix step
1 parent 0f74bb3 commit 3df1f9c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/plots/cartesian/axes.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,17 +1654,17 @@ axes.tickText = function(ax, x, hover, noSuffixPrefix) {
16541654
else if(isAngular(ax)) formatAngle(ax, out, hover, extraPrecision, hideexp);
16551655
else formatLinear(ax, out, hover, extraPrecision, hideexp);
16561656

1657-
if(ax.labelalias) {
1658-
var t = ax.labelalias[out.text];
1659-
if(typeof t === 'string') out.text = t;
1660-
}
1661-
16621657
// add prefix and suffix
16631658
if(!noSuffixPrefix) {
16641659
if(ax.tickprefix && !isHidden(ax.showtickprefix)) out.text = ax.tickprefix + out.text;
16651660
if(ax.ticksuffix && !isHidden(ax.showticksuffix)) out.text += ax.ticksuffix;
16661661
}
16671662

1663+
if(ax.labelalias) {
1664+
var t = ax.labelalias[out.text];
1665+
if(typeof t === 'string') out.text = t;
1666+
}
1667+
16681668
// Setup ticks and grid lines boundaries
16691669
// at 1/2 a 'category' to the left/bottom
16701670
if(ax.tickson === 'boundaries' || ax.showdividers) {

src/plots/cartesian/layout_attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ module.exports = {
641641
'Determines the alias for certain labels for ticks and hover.',
642642
'For example using {US: \'USA\', CA: \'Canada\'} maps US to USA',
643643
'and CA to Canada if tick or hover labels match US or Canada i.e.',
644-
'before adding prefix and suffix to labels.'
644+
'after adding prefix and suffix to labels.'
645645
].join(' ')
646646
},
647647
automargin: {

test/image/baselines/polar_blank.png

-200 Bytes
Loading

0 commit comments

Comments
 (0)