@@ -998,6 +998,11 @@ describe('pie hovering', function() {
998998 Lib . clearThrottle ( ) ;
999999 }
10001000
1001+ function _hover2 ( ) {
1002+ mouseEvent ( 'mouseover' , 200 , 250 ) ;
1003+ Lib . clearThrottle ( ) ;
1004+ }
1005+
10011006 function assertLabel ( content , style , msg ) {
10021007 assertHoverLabelContent ( { nums : content } , msg ) ;
10031008
@@ -1103,6 +1108,27 @@ describe('pie hovering', function() {
11031108 . then ( done ) ;
11041109 } ) ;
11051110
1111+ it ( 'should show falsy zero text' , function ( done ) {
1112+ Plotly . plot ( gd , {
1113+ data : [ {
1114+ type : 'pie' ,
1115+ labels : [ 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' ] ,
1116+ values : [ 7 , 6 , 5 , 4 , 3 , 2 , 1 ] ,
1117+ text : [ null , '' , '0' , 0 , 1 , true , false ] ,
1118+ textinfo : 'label+text+value'
1119+ } ] ,
1120+ layout : {
1121+ width : 400 ,
1122+ height : 400
1123+ }
1124+ } )
1125+ . then ( _hover2 )
1126+ . then ( function ( ) {
1127+ assertLabel ( 'D\n0\n4\n14.3%' ) ;
1128+ } )
1129+ . then ( done ) ;
1130+ } ) ;
1131+
11061132 it ( 'should use hovertemplate if specified' , function ( done ) {
11071133 mockCopy . data [ 0 ] . name = '' ;
11081134 Plotly . plot ( gd , mockCopy . data , mockCopy . layout )
0 commit comments