From 063710398dd2f868db0d84a6c630e96a74b2280d Mon Sep 17 00:00:00 2001 From: junedchhipa Date: Tue, 17 Oct 2023 01:34:07 +0530 Subject: [PATCH] only draw smooth curve if more than 1 data-point; fixes #4049 --- src/charts/Line.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/charts/Line.js b/src/charts/Line.js index e1c2b1f57..418300873 100644 --- a/src/charts/Line.js +++ b/src/charts/Line.js @@ -724,13 +724,13 @@ class Line { ? xArrj.length === w.globals.dataPoints : j === series[i].length - 2 - if (shouldRenderMonotone) { - const smoothInputs = xArrj - .map((_, i) => { - return [xArrj[i], yArrj[i]] - }) - .filter((_) => _[1] !== null) + const smoothInputs = xArrj + .map((_, i) => { + return [xArrj[i], yArrj[i]] + }) + .filter((_) => _[1] !== null) + if (shouldRenderMonotone && smoothInputs.length > 1) { const points = spline.points(smoothInputs) linePath += svgPath(points)