-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Zero values skipped on logarithmic scale line chart #9629
Comments
|
Yes, Log(0) is undefined, and there are infinite points between 0 and the next lowest data value; however, 0 should be considered a valid data value on the graph given that we are not taking the log of the data value, but changing the rate of growth of the y axis. In your example, we could change the min to any point between the lowest data value and 0, but it would completely change the log growth of the y scale. As for possible solutions, are the methods that were used previously no longer available? It looks like there was a solution created for version 2.7 to create a 0 tick on the graph. #4913 |
Okay, that solves the issue for my use case. Thanks for the help. For people running across this thread, I updated all |
❤️ 🤣 uPlot takes a slightly different approach and renders <= 0 an extra order of magnitude below the plot edge (see bottom chart in https://leeoniya.github.io/uPlot/demos/log-scales2.html). but you can "fake it" there, too. |
I'm having the same issue. But I don't want to use this workaround as it will show value |
Hello, log10 of 0 is -infinity... The zero value need to be compute in exception case |
For now, points at 0 are skipped |
Hello, Same problem on version 3.9.1 |
I am too affected by this issue. I understand the fact that mathematically speaking log(0) is -infinity and if we were to be strictly mathematically correct, the distance between any epsilon>0 and -infinity on the scale should be infinite. However, from a user perspective, I don't care about that. I just want a 0 line in the chart with a very small distance between it and the next >0 value. This is certainly doable and would be very helpful. It doesn't have to be 100% mathematically accurate, I can accept a small error below the smallest positive value for the sake of having the lines uninterrupted and able to show 0 values. The value in user experience that this would bring greatly outweighs the theoretical inaccuracy. |
Expected Behavior
A line chart should be able to display values of 0 along the bottom axis and the y axis should start at zero if the y scale is logarithmic.
Current Behavior
Values of 0 on a logarithmic scale line chart are not shown on the chart.
min:0
andbeginAtZero: true
both appear to have no effect on the issue that 0 does not appear on the line chart.This functionality appears to be working in v2. In v3.0.2 it somewhat works by displaying the 0 points at the bottom of the chart, however the scale is still not set to 0.
Steps to Reproduce
https://codepen.io/flesher1/pen/WNORQoQ
Provide a dataset containing 0s. Use a line graph with logarithmic scale. Copying example below:
Context
In this case, I have Data that contains 10s, 20s, 0s, and numbers around 80,000.
Environment
The text was updated successfully, but these errors were encountered: