Skip to content

Commit 34e3168

Browse files
committed
Added hovermode='x' (or 'y') when stacked bar charts are present.
1 parent e0b24ab commit 34e3168

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plotly/matplotlylib/renderer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ def draw_bar(self, coll):
243243
for old, new in zip(old_heights, new_heights):
244244
if abs(old - new) > tol:
245245
self.plotly_fig['layout']['barmode']='stack'
246+
self.plotly_fig['layout']['hovermode']='x'
246247
x = [bar['x0']+(bar['x1']-bar['x0'])/2 for bar in trace]
247248
y = [bar['y1'] for bar in trace]
248249
bar_gap = mpltools.get_bar_gap([bar['x0'] for bar in trace],
@@ -257,6 +258,7 @@ def draw_bar(self, coll):
257258
for old, new in zip(old_rights, new_rights):
258259
if abs(old - new) > tol:
259260
self.plotly_fig['layout']['barmode']='stack'
261+
self.plotly_fig['layout']['hovermode']='y'
260262
x = [bar['x1'] for bar in trace]
261263
y = [bar['y0']+(bar['y1']-bar['y0'])/2 for bar in trace]
262264
bar_gap = mpltools.get_bar_gap([bar['y0'] for bar in trace],

0 commit comments

Comments
 (0)