Skip to content

Commit 61e8277

Browse files
committed
Fix positioning of colorbar titles
1 parent 2177901 commit 61e8277

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/colorbar/draw.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,18 +357,18 @@ function drawColorBar(g, opts, gd) {
357357
var x, y;
358358

359359
if(titleSide === 'top') {
360-
x = xpad + gs.l + gs.w * optsX;
361-
y = ypad + gs.t + gs.h * (1 - vFrac - lenFrac) + 3 + titleFontSize * 0.75;
360+
x = xpad + gs.l + posW * optsX;
361+
y = ypad + gs.t + posH * (1 - vFrac - lenFrac) + 3 + titleFontSize * 0.75;
362362
}
363363

364364
if(titleSide === 'bottom') {
365-
x = xpad + gs.l + gs.w * optsX;
366-
y = ypad + gs.t + gs.h * (1 - vFrac) - 3 - titleFontSize * 0.25;
365+
x = xpad + gs.l + posW * optsX;
366+
y = ypad + gs.t + posH * (1 - vFrac) - 3 - titleFontSize * 0.25;
367367
}
368368

369369
if(titleSide === 'right') {
370-
y = ypad + gs.t + gs.h * optsY + 3 + titleFontSize * 0.75;
371-
x = xpad + gs.l + gs.w * vFrac;
370+
y = ypad + gs.t + posW * optsY + 3 + titleFontSize * 0.75;
371+
x = xpad + gs.l + posH * vFrac;
372372
}
373373

374374
drawTitle(ax._id + 'title', {

0 commit comments

Comments
 (0)