File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1276,7 +1276,7 @@ fx.click = function(gd,evt){
12761276 if ( gd . _hoverdata && evt && evt . target ) {
12771277 gd . emit ( 'plotly_click' , { points : gd . _hoverdata } ) ;
12781278 // why do we get a double event without this???
1279- evt . stopImmediatePropagation ( ) ;
1279+ if ( evt . stopImmediatePropagation ) evt . stopImmediatePropagation ( ) ;
12801280 }
12811281} ;
12821282
Original file line number Diff line number Diff line change @@ -373,6 +373,12 @@ pie.plot = function(gd, cdpie) {
373373 }
374374 }
375375
376+ function handleClick ( evt ) {
377+ gd . _hoverdata = pt ;
378+ gd . _hoverdata . trace = slices [ 0 ] [ 0 ] . __data__ . trace ;
379+ Plotly . Fx . click ( gd , { target : true } ) ;
380+ }
381+
376382 slicePath . enter ( ) . append ( 'path' )
377383 . classed ( 'surface' , true )
378384 . style ( { 'pointer-events' : 'all' } ) ;
@@ -381,7 +387,8 @@ pie.plot = function(gd, cdpie) {
381387
382388 sliceTop
383389 . on ( 'mouseover' , handleMouseOver )
384- . on ( 'mouseout' , handleMouseOut ) ;
390+ . on ( 'mouseout' , handleMouseOut )
391+ . on ( 'click' , handleClick ) ;
385392
386393 if ( trace . pull ) {
387394 var pull = + ( Array . isArray ( trace . pull ) ? trace . pull [ pt . i ] : trace . pull ) || 0 ;
You can’t perform that action at this time.
0 commit comments