Skip to content

Commit 0331a16

Browse files
committed
test case for category range histogram hover labels
1 parent 2696c1c commit 0331a16

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/jasmine/tests/hover_label_test.js

+28
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,34 @@ describe('hover info', function() {
598598
.catch(fail)
599599
.then(done);
600600
});
601+
602+
it('will show a category range if you ask nicely', function(done) {
603+
var gd = createGraphDiv();
604+
605+
Plotly.plot(gd, [{
606+
// even though the data aren't regularly spaced, each bin only has
607+
// one data value in it so we see exactly that value
608+
x: [
609+
'bread', 'cheese', 'artichokes', 'soup', 'beans', 'nuts',
610+
'pizza', 'potatoes', 'burgers', 'beans', 'beans', 'beans'
611+
],
612+
xbins: {start: -0.5, end: 8.5, size: 3},
613+
type: 'histogram'
614+
}], {
615+
width: 500,
616+
height: 400,
617+
margin: {l: 0, t: 0, r: 0, b: 0}
618+
})
619+
.then(function() {
620+
_hover(gd, 250, 200);
621+
assertHoverLabelContent({
622+
nums: '6',
623+
axis: 'soup - nuts'
624+
});
625+
})
626+
.catch(fail)
627+
.then(done);
628+
});
601629
});
602630

603631
describe('histogram2d hover info', function() {

0 commit comments

Comments
 (0)