File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -149,8 +149,8 @@ module.exports = function calc(gd, trace) {
149149 else if ( xVals [ n ] !== xi ) uniqueValsPerX = false ;
150150 }
151151 if ( uniqueValsPerY ) {
152- if ( yVals [ n ] === undefined ) yVals [ n ] = yi ;
153- else if ( yVals [ n ] !== yi ) uniqueValsPerY = false ;
152+ if ( yVals [ m ] === undefined ) yVals [ m ] = yi ;
153+ else if ( yVals [ m ] !== yi ) uniqueValsPerY = false ;
154154 }
155155
156156 xGapLow = Math . min ( xGapLow , xi - xEdges [ n ] ) ;
Original file line number Diff line number Diff line change @@ -1225,6 +1225,26 @@ describe('hover info', function() {
12251225 . then ( done ) ;
12261226 } ) ;
12271227
1228+ it ( 'shows the data range when bins have multiple values (case 2)' , function ( done ) {
1229+ var gd = createGraphDiv ( ) ;
1230+
1231+ Plotly . plot ( gd , [ {
1232+ type : 'histogram2d' ,
1233+ x : [ 'a' , 'b' , 'c' , 'a' ] ,
1234+ y : [ 7 , 2 , 3 , 7 ] ,
1235+ nbinsy : 3
1236+ } ] , {
1237+ width : 600 ,
1238+ height : 600
1239+ } )
1240+ . then ( function ( ) {
1241+ _hover ( gd , 250 , 200 ) ;
1242+ assertHoverLabelContent ( { nums : [ 'x: b' , 'y: 4 - 5' , 'z: 0' ] . join ( '\n' ) } ) ;
1243+ } )
1244+ . catch ( failTest )
1245+ . then ( done ) ;
1246+ } ) ;
1247+
12281248 it ( 'shows the exact data when bins have single values' , function ( done ) {
12291249 var gd = createGraphDiv ( ) ;
12301250
You can’t perform that action at this time.
0 commit comments