Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix isolated point in line chart not closing path #4782

Merged

Conversation

bautisflow
Copy link
Contributor

With a Line chart representing a time series, isolated points were trying to close a path. This PR fixes this issue by checking that the point is unique using the already present logic that was handling isolated points in between null values.

Current version (4.0.0) jsfiddle showcasing the issue: https://jsfiddle.net/kocz16s2/

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • My branch is up to date with any changes from the main branch

@junedchhipa junedchhipa merged commit afb0aa0 into apexcharts:main Nov 2, 2024
@junedchhipa
Copy link
Contributor

This PR caused this bug - #4855
Hence, I am reverting this and will look for other ways to solve it.

@bautisflow
Copy link
Contributor Author

Hi @junedchhipa
I think a solution for the linked issue and in order to keep this PR is to check for the length of the series before trying to create a path.

for (let j = 0; j < iterations; j++) {

By checking it just as this loop is entered both issues could be fixed, and as far as I got it does not seem that it is required to loop over the maximum range of dataPoints for the series for the hidden one.

Let me now if this solution suits the project and if you want me to create a PR

Regards

@junedchhipa
Copy link
Contributor

Sure, please create a new PR

junedchhipa added a commit that referenced this pull request Dec 17, 2024
…ries

Breaks loop when iterating over empty series and restores #4782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants