Skip to content

Commit

Permalink
fix NaN issue in area paths - fixes #374
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Mar 4, 2019
1 parent 1cd3c04 commit 1ef771f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/charts/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ class Line {
: w.globals.dataPoints
for (let j = 0; j < iterations; j++) {
if (w.globals.isXNumeric) {
x = (w.globals.seriesX[realIndex][j + 1] - w.globals.minX) / xRatio
let sX = w.globals.seriesX[realIndex][j + 1]
if (typeof w.globals.seriesX[realIndex][j + 1] === 'undefined') {
/* fix #374 */
sX = w.globals.seriesX[realIndex][iterations - 1]
}
x = (sX - w.globals.minX) / xRatio
} else {
x = x + xDivision
}
Expand Down

0 comments on commit 1ef771f

Please sign in to comment.