Skip to content

Commit

Permalink
Lines from series with only two points were not rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
rosco54 committed Apr 7, 2024
1 parent 4604653 commit 4069f10
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 4069f10

Please sign in to comment.