Skip to content

Commit

Permalink
Merge pull request #4391 from rosco54/Two_point_series_fix
Browse files Browse the repository at this point in the history
Lines from series with only two points were not rendering.
  • Loading branch information
junedchhipa authored Apr 7, 2024
2 parents 4604653 + 4069f10 commit aac9485
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/charts/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,11 +933,14 @@ class Line {
}
areaPath = graphics.move(pX, pY)

let p = graphics.curve(pX + length, pY, x - length, y, x, y)
linePath += p
areaPath += p
pathState = 1
break
if (j < series[i].length - 2) {
let p = graphics.curve(pX + length, pY, x - length, y, x, y)
linePath += p
areaPath += p
break
}
// Continue on with pathState 1 to finish the path and exit
case 1:
// Continuing with segment
if (series[i][j + 1] === null) {
Expand Down Expand Up @@ -1016,11 +1019,14 @@ class Line {
}
areaPath = graphics.move(pX, pY)

let p = pathToPoint(curve, x, y)
linePath += p
areaPath += p
pathState = 1
break
if (j < series[i].length - 2) {
let p = pathToPoint(curve, x, y)
linePath += p
areaPath += p
break
}
// Continue on with pathState 1 to finish the path and exit
case 1:
// Continuing with segment
if (series[i][j + 1] === null) {
Expand Down

0 comments on commit aac9485

Please sign in to comment.