Skip to content

Commit 2aac8d3

Browse files
committed
fixes #1753; fixes #3641; markers disappearing after hover
1 parent a73effb commit 2aac8d3

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

src/charts/Line.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,25 @@ class Line {
297297
'data:realIndex': realIndex,
298298
})
299299

300+
if (w.globals.hasNullValues) {
301+
// fixes https://github.com/apexcharts/apexcharts.js/issues/3641
302+
const firstPoint = this.markers.plotChartMarkers(
303+
{
304+
x: [w.globals.minX - 100],
305+
y: [w.globals.minY - 100],
306+
},
307+
i,
308+
0,
309+
0.1,
310+
true
311+
)
312+
313+
if (firstPoint !== null) {
314+
// firstPoint is rendered for cases where there are null values and when dynamic markers are required
315+
this.elPointsMain.add(firstPoint)
316+
}
317+
}
318+
300319
// eldatalabels
301320
this.elDataLabelsWrap = graphics.group({
302321
class: 'apexcharts-datalabels',
@@ -587,7 +606,7 @@ class Line {
587606
let segmentStartX
588607

589608
for (let j = 0; j < iterations; j++) {
590-
if (series[i].length === 0) break;
609+
if (series[i].length === 0) break
591610

592611
const isNull =
593612
typeof series[i][j + 1] === 'undefined' || series[i][j + 1] === null
@@ -956,7 +975,10 @@ class Line {
956975
areaPath = graphics.move(pX, pY)
957976

958977
// Check for single isolated point
959-
if (series[i][j + 1] === null || typeof series[i][j + 1] === 'undefined') {
978+
if (
979+
series[i][j + 1] === null ||
980+
typeof series[i][j + 1] === 'undefined'
981+
) {
960982
linePaths.push(linePath)
961983
areaPaths.push(areaPath)
962984
// Stay in pathState = 0;
@@ -1045,7 +1067,10 @@ class Line {
10451067
areaPath = graphics.move(pX, pY)
10461068

10471069
// Check for single isolated point
1048-
if (series[i][j + 1] === null || typeof series[i][j + 1] === 'undefined') {
1070+
if (
1071+
series[i][j + 1] === null ||
1072+
typeof series[i][j + 1] === 'undefined'
1073+
) {
10491074
linePaths.push(linePath)
10501075
areaPaths.push(areaPath)
10511076
// Stay in pathState = 0

0 commit comments

Comments
 (0)