diff --git a/nv.d3.js b/nv.d3.js index 1448aa9..4ddf400 100644 --- a/nv.d3.js +++ b/nv.d3.js @@ -3222,7 +3222,11 @@ nv.models.cumulativeLineChart = function() { if (!line.values) { return line; } - var v = lines.y()(line.values[idx], idx); + var indexValue = line.values[idx]; + if (indexValue == null) { + return line; + } + var v = lines.y()(indexValue, idx); //TODO: implement check below, and disable series if series loses 100% or more cause divide by 0 issue if (v < -.95 && !noErrorCheck) { diff --git a/src/models/cumulativeLineChart.js b/src/models/cumulativeLineChart.js index 9273144..d2de8bb 100644 --- a/src/models/cumulativeLineChart.js +++ b/src/models/cumulativeLineChart.js @@ -740,7 +740,11 @@ nv.models.cumulativeLineChart = function() { if (!line.values) { return line; } - var v = lines.y()(line.values[idx], idx); + var indexValue = line.values[idx]; + if (indexValue == null) { + return line; + } + var v = lines.y()(indexValue, idx); //TODO: implement check below, and disable series if series loses 100% or more cause divide by 0 issue if (v < -.95 && !noErrorCheck) {