-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
xaxis labels showing weird(incorrect) values #4067
xaxis labels showing weird(incorrect) values #4067
Comments
I'm having a similar issue probably caused by the same bug. In a rangeBar chart where the ranges in the y-axis are floats, e.g. [1.1, 1.2], the tooltip always shows them as integers e.g. "1 - 1". If i define tooltip.y.formatter, receiving two arguments (value, obj), then I see that it is called 7 times. The first two times (one per item in the range) it is called with integers as value and the object is undefined. The return value from these are assumedly the ones that are shown in the GUI. Then it is called once with the float value of the second part of the range, but still no object. Then finally two times for both parts of the range, with both the float value and the object containing series, seriesIndex etc). These latter four calls (although only two should suffice) have the correct arguments and should be the ones used to actually display the values, but they are not. How to reproduce:
The log output when hovering the [7.1, 8.1] range:
|
Same bug here |
If you're looking for a quick fix, just convert the labels to string. |
Description
The x-axis labels are displayed in mismatched values as decimal numbers, even though the data for the chart is integers.
Steps to Reproduce
notice that x coordinate values are integers.
Expected Behavior
The labels on the x-axis should correspond to the data provided as the tooltip label does.
Actual Behavior
The labels on the x-axis do not correspond to the data provided.
Also, the values change when you console.log them or not:
Reproduction Link
I recreated the code several times
template Codepen here
StackBlitz TypeScript here
StackBlitz React here
When the problem occured
I found out that the problem occured in versions from @3.6.12 and above, the previous versions(@3.6.11 and lower) are working as expected.
The text was updated successfully, but these errors were encountered: