echarts
echarts copied to clipboard
feat(chart): support negative values in logarithmic axes
The logarithm of negative values is not defined. However, in the case of a logarithmic chart axis, it makes sense to define log(-x) as -log(x), to support logarithmic axes with negative values.
Cf. 'symlog' in matplotlib
Resolves: #15558 Resolves: #17459
Brief Information
This pull request is in the type of:
- [ ] bug fixing
- [X] new feature
- [ ] others
What does this PR do?
Supports negative values in logarithmic axes.
Fixed issues
- #15558
- #17459
Details
Before: What was the problem?
Axes with logarithmic scales didn't support negative values, because Math.log() of a negative number is undefined (NaN). Therefore the ticks on the yAxis disappeared entirely.
After: How is it fixed in this PR?
Negative values for logarithmic scales work by defining log(-x) = -log(x) and negative values are shown on logarithmic axes.
Misc
Related test cases or examples to use the new APIs
test/bar-log-negative.html
Others
Merging options
- [ ] Please squash the commits into a single one when merging.
Other information
Thanks for your contribution! The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.
To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged
This message is shown because the PR description doesn't contain the document related template.
Hey @andreasgerstmayr, do you know if they have an estimated deadline for reviewing/merging the PR? I'm facing the same problem here
Hey @andreasgerstmayr, do you know if they have an estimated deadline for reviewing/merging the PR? I'm facing the same problem here
I don't know, I'd also like to get this PR merged :)
I would also love to see this merged. Is there anything we could do to help this along?
@octoth0rpe was there something still missing from this PR?
This feature would be highly appreciated ❤️
Tested this PR locally and it seems to be working well!
@octoth0rpe was there something still missing from this PR?
Nothing from my perspective, but I'm not an echarts maintainer 🤷 Just another user who wants this feature!
@Ovilia, it seems this PR has been lost in the pile of PRs. I checked that you had contributed to the log scaling before. Can you check this or maybe think of someone who could help make progress in this?