Skip to content

Commit b84143a

Browse files
authored
Merge pull request #90 from tillsc/master
Fix loess calclulation for non array data
2 parents 26bccd5 + a8778da commit b84143a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

highcharts-regression.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
(function(factory) {
1+
(function(factory) {
22
"use strict";
3-
3+
44
if (typeof module === "object" && module.exports) {
55
module.exports = factory;
66
} else {
@@ -17,7 +17,7 @@
1717
void 0;
1818
}
1919
}
20-
}
20+
}
2121
}(function (H) {
2222
var processSerie = function (s, method, chart) {
2323
if (s.regression && !s.rendered) {
@@ -455,7 +455,7 @@
455455
bandwidth = bandwidth || 0.25;
456456

457457
var xval = data.map(function (pair) {
458-
return pair[0];
458+
return pair.x || pair[0];
459459
});
460460
var distinctX = array_unique(xval);
461461
if (2 / distinctX.length > bandwidth) {
@@ -464,7 +464,7 @@
464464
}
465465

466466
var yval = data.map(function (pair) {
467-
return pair[1];
467+
return pair.y || pair[1];
468468
});
469469

470470
function array_unique(values) {

0 commit comments

Comments
 (0)