Skip to content

Commit aac9485

Browse files
authored
Merge pull request #4391 from rosco54/Two_point_series_fix
Lines from series with only two points were not rendering.
2 parents 4604653 + 4069f10 commit aac9485

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/charts/Line.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -933,11 +933,14 @@ class Line {
933933
}
934934
areaPath = graphics.move(pX, pY)
935935

936-
let p = graphics.curve(pX + length, pY, x - length, y, x, y)
937-
linePath += p
938-
areaPath += p
939936
pathState = 1
940-
break
937+
if (j < series[i].length - 2) {
938+
let p = graphics.curve(pX + length, pY, x - length, y, x, y)
939+
linePath += p
940+
areaPath += p
941+
break
942+
}
943+
// Continue on with pathState 1 to finish the path and exit
941944
case 1:
942945
// Continuing with segment
943946
if (series[i][j + 1] === null) {
@@ -1016,11 +1019,14 @@ class Line {
10161019
}
10171020
areaPath = graphics.move(pX, pY)
10181021

1019-
let p = pathToPoint(curve, x, y)
1020-
linePath += p
1021-
areaPath += p
10221022
pathState = 1
1023-
break
1023+
if (j < series[i].length - 2) {
1024+
let p = pathToPoint(curve, x, y)
1025+
linePath += p
1026+
areaPath += p
1027+
break
1028+
}
1029+
// Continue on with pathState 1 to finish the path and exit
10241030
case 1:
10251031
// Continuing with segment
10261032
if (series[i][j + 1] === null) {

0 commit comments

Comments
 (0)