Skip to content

Commit 6e243de

Browse files
committed
Fix marker positioning and across rendering for top-side x-axes.
1 parent 8c7ac76 commit 6e243de

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/plots/cartesian/graph_interact.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -881,13 +881,14 @@ function createSpikelines(hoverData, opts) {
881881
xEndSpike = c0.xa.spikemode.indexOf('across') !== -1 ?
882882
(ySide === 'left' ? xBase + xLength : xBase - xLength) :
883883
xPoint,
884-
yEndSpike = c0.ya.spikemode.indexOf('across') !== -1 ? yBase - yLength : yPoint;
884+
yEndSpike = c0.ya.spikemode.indexOf('across') !== -1 ?
885+
(xSide === 'bottom' ? yBase - yLength : yBase + yLength) :
886+
yPoint;
885887

886888
// Remove old spikeline items
887889
container.selectAll('line.spikeline').remove();
888890
container.selectAll('circle.spikeline').remove();
889891

890-
891892
if(c0.ya.showspikes) {
892893
if(ySpikeLine) {
893894
// Background horizontal Line (to y-axis)
@@ -966,7 +967,7 @@ function createSpikelines(hoverData, opts) {
966967
container.append('circle')
967968
.attr({
968969
'cx': xPoint,
969-
'cy': yAnchoredBase - xThickness,
970+
'cy': yAnchoredBase - (xSide !== 'top' ? xThickness : -xThickness),
970971
'r': xThickness,
971972
'fill': xColor
972973
})

0 commit comments

Comments
 (0)