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

Issue with negative yAxis values on areachart #51

Open
jakubvojacek opened this issue Feb 18, 2025 · 3 comments
Open

Issue with negative yAxis values on areachart #51

jakubvojacek opened this issue Feb 18, 2025 · 3 comments

Comments

@jakubvojacek
Copy link

Hello @pawelfus

first of all, thank you for a great plugin!

It works out of the box almost perfectly. I am just having issues with datasets that go under zero on yAxis, attaching two samples below. One is with the plugin enabled and one with disabled.

Image Image

As you can see, it does not work perfectly below zero. I would like for it to work like the first chart, just with the colors. That is to show negative elevation correctly.

Is there something that you would suggest that I do?

Thank you very much
Jakub

@pawelfus
Copy link
Collaborator

Hello @jakubvojacek

Thank you! It seems you've found a bug. threshold = null support seems to be missing. Temporary workaround in action: https://jsfiddle.net/BlackLabel/ou4L32cn/12/ - could you test it out and let us know the results? Thanks!

Plugin:

(function (H) {
  H.wrap(
    H.seriesTypes.coloredarea.prototype,
    "getSegmentPath",
    function (p, ...args) {
      const threshold = this.options.threshold;

      if (threshold === null) {
        this.options.threshold = this.yAxis.min;
      }

      const ret = p.apply(this, args);

      this.options.threshold = threshold;

      return ret;
    },
  )
})(Highcharts)

@jakubvojacek
Copy link
Author

You are a magician! Thank you!

Image

works like a charm ❤

Do you want me to close the issue or do you want to close it with a merge request?

@pawelfus
Copy link
Collaborator

Great to hear that!
Let's keep it open 👍 We want to fix the library too

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

No branches or pull requests

2 participants