Skip to content

Commit

Permalink
only draw smooth curve if more than 1 data-point; fixes #4049
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Oct 16, 2023
1 parent ebd7c8f commit 0637103
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/charts/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0637103

Please sign in to comment.