Skip to content

Commit 09181b1

Browse files
authoredJun 26, 2017
Merge pull request #1808 from plotly/fix-append-array-point-value
Fix hover error in appendArrayPointValue
2 parents cb9e329 + 96767d8 commit 09181b1

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
 

Diff for: ‎src/components/fx/helpers.js

+4
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ function quadrature(dx, dy) {
9494
exports.appendArrayPointValue = function(pointData, trace, pointNumber) {
9595
var arrayAttrs = trace._arrayAttrs;
9696

97+
if(!arrayAttrs) {
98+
return;
99+
}
100+
97101
for(var i = 0; i < arrayAttrs.length; i++) {
98102
var astr = arrayAttrs[i];
99103
var key;

Diff for: ‎test/jasmine/tests/hover_label_test.js

+25
Original file line numberDiff line numberDiff line change
@@ -1299,3 +1299,28 @@ describe('Test hover label custom styling:', function() {
12991299
.then(done);
13001300
});
13011301
});
1302+
1303+
describe('ohlc hover interactions', function() {
1304+
var data = [{
1305+
type: 'candlestick',
1306+
x: ['2011-01-01', '2012-01-01'],
1307+
open: [2, 2],
1308+
high: [3, 3],
1309+
low: [0, 0],
1310+
close: [3, 3],
1311+
}];
1312+
1313+
beforeEach(function() {
1314+
this.gd = createGraphDiv();
1315+
});
1316+
1317+
afterEach(destroyGraphDiv);
1318+
1319+
// See: https://github.com/plotly/plotly.js/issues/1807
1320+
it('should not fail in appendArrayPointValue', function() {
1321+
Plotly.plot(this.gd, data);
1322+
mouseEvent('mousemove', 203, 213);
1323+
1324+
expect(d3.select('.hovertext').size()).toBe(1);
1325+
});
1326+
});

0 commit comments

Comments
 (0)
Please sign in to comment.