Skip to content

Commit e6c4dad

Browse files
committed
align hover label to the left for negative radial coords
1 parent 971c6f6 commit e6c4dad

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/traces/barpolar/hover.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,9 @@ module.exports = function hoverPoints(pointData, xval, yval) {
6262
pointData.color = getTraceColor(trace, cdi);
6363
pointData.xLabelVal = pointData.yLabelVal = undefined;
6464

65+
if(cdi.s < 0) {
66+
pointData.idealAlign = 'left';
67+
}
68+
6569
return [pointData];
6670
};

test/jasmine/tests/barpolar_test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ describe('Test barpolar hover:', function() {
252252
x: 200,
253253
y: 247.5,
254254
extraText: 'r: −5<br>θ: 270°',
255-
color: '#1f77b4'
255+
color: '#1f77b4',
256+
idealAlign: 'left'
256257
}
257258
}, {
258259
desc: 'works on reversed radial axis ranges',

0 commit comments

Comments
 (0)