Skip to content

Commit

Permalink
fixes #1753; fixes #3641; markers disappearing after hover
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Dec 25, 2024
1 parent a73effb commit 2aac8d3
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions src/charts/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,25 @@ class Line {
'data:realIndex': realIndex,
})

if (w.globals.hasNullValues) {
// fixes https://github.com/apexcharts/apexcharts.js/issues/3641
const firstPoint = this.markers.plotChartMarkers(
{
x: [w.globals.minX - 100],
y: [w.globals.minY - 100],
},
i,
0,
0.1,
true
)

if (firstPoint !== null) {
// firstPoint is rendered for cases where there are null values and when dynamic markers are required
this.elPointsMain.add(firstPoint)
}
}

// eldatalabels
this.elDataLabelsWrap = graphics.group({
class: 'apexcharts-datalabels',
Expand Down Expand Up @@ -587,7 +606,7 @@ class Line {
let segmentStartX

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

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

// Check for single isolated point
if (series[i][j + 1] === null || typeof series[i][j + 1] === 'undefined') {
if (
series[i][j + 1] === null ||
typeof series[i][j + 1] === 'undefined'
) {
linePaths.push(linePath)
areaPaths.push(areaPath)
// Stay in pathState = 0;
Expand Down Expand Up @@ -1045,7 +1067,10 @@ class Line {
areaPath = graphics.move(pX, pY)

// Check for single isolated point
if (series[i][j + 1] === null || typeof series[i][j + 1] === 'undefined') {
if (
series[i][j + 1] === null ||
typeof series[i][j + 1] === 'undefined'
) {
linePaths.push(linePath)
areaPaths.push(areaPath)
// Stay in pathState = 0
Expand Down

0 comments on commit 2aac8d3

Please sign in to comment.