@@ -998,6 +998,11 @@ describe('pie hovering', function() {
998
998
Lib . clearThrottle ( ) ;
999
999
}
1000
1000
1001
+ function _hover2 ( ) {
1002
+ mouseEvent ( 'mouseover' , 200 , 250 ) ;
1003
+ Lib . clearThrottle ( ) ;
1004
+ }
1005
+
1001
1006
function assertLabel ( content , style , msg ) {
1002
1007
assertHoverLabelContent ( { nums : content } , msg ) ;
1003
1008
@@ -1103,6 +1108,27 @@ describe('pie hovering', function() {
1103
1108
. then ( done ) ;
1104
1109
} ) ;
1105
1110
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
+
1106
1132
it ( 'should use hovertemplate if specified' , function ( done ) {
1107
1133
mockCopy . data [ 0 ] . name = '' ;
1108
1134
Plotly . plot ( gd , mockCopy . data , mockCopy . layout )
0 commit comments