Skip to content

Commit ca962bc

Browse files
committed
use c2l instead of c2r
1 parent 33e1783 commit ca962bc

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/traces/bar/plot.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -647,15 +647,11 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
647647
}
648648

649649
function formatLabel(u) {
650-
if(pAxis.type === 'log') u = pAxis.c2r(u);
651-
652-
return tickText(pAxis, u, true).text;
650+
return tickText(pAxis, pAxis.c2l(u), true).text;
653651
}
654652

655653
function formatNumber(v) {
656-
if(vAxis.type === 'log') v = vAxis.c2r(v);
657-
658-
return tickText(vAxis, +v, true).text;
654+
return tickText(vAxis, vAxis.c2l(v), true).text;
659655
}
660656

661657
var cdi = cd[index];

src/traces/scatter/format_labels.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ module.exports = function formatLabels(cdi, trace, fullLayout) {
99
var xa = Axes.getFromTrace(mockGd, trace, 'x');
1010
var ya = Axes.getFromTrace(mockGd, trace, 'y');
1111

12-
var x = cdi.x;
13-
var y = cdi.y;
14-
15-
if(xa.type === 'log') x = xa.c2r(x);
16-
if(ya.type === 'log') y = ya.c2r(y);
17-
18-
labels.xLabel = Axes.tickText(xa, x, true).text;
19-
labels.yLabel = Axes.tickText(ya, y, true).text;
12+
labels.xLabel = Axes.tickText(xa, xa.c2l(cdi.x), true).text;
13+
labels.yLabel = Axes.tickText(ya, ya.c2l(cdi.y), true).text;
2014

2115
return labels;
2216
};

0 commit comments

Comments
 (0)