File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -1528,6 +1528,37 @@ describe('waterfall hover', function() {
1528
1528
. then ( done , done . fail ) ;
1529
1529
} ) ;
1530
1530
1531
+ it ( 'should provide delta hovertemplate on totals similar to hovertext' , function ( done ) {
1532
+ gd = createGraphDiv ( ) ;
1533
+
1534
+ function _hover ( ) {
1535
+ var evt = { xpx : 400 , ypx : 100 } ;
1536
+ Fx . hover ( 'graph' , evt , 'xy' ) ;
1537
+ }
1538
+
1539
+ Plotly . newPlot ( gd , {
1540
+ data : [ {
1541
+ type : 'waterfall' ,
1542
+ y : [ 10 , - 4 , null ] ,
1543
+ measure : [ '' , '' , 'total' ] ,
1544
+ texttemplate : '%{delta}' ,
1545
+ hovertemplate : '%{delta}' ,
1546
+ } ] ,
1547
+ layout : {
1548
+ width : 600 ,
1549
+ height : 400
1550
+ }
1551
+ } )
1552
+ . then ( _hover )
1553
+ . then ( function ( ) {
1554
+ assertHoverLabelContent ( {
1555
+ nums : '6' ,
1556
+ name : 'trace 0'
1557
+ } ) ;
1558
+ } )
1559
+ . then ( done , done . fail ) ;
1560
+ } ) ;
1561
+
1531
1562
it ( 'should format numbers - round hover precision' , function ( done ) {
1532
1563
gd = createGraphDiv ( ) ;
1533
1564
You can’t perform that action at this time.
0 commit comments