-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Bug]: Date axis labels formatted to show only the year are being localized as if they were numbers #30128
Comments
@krkshitij This is primarily because a Date Axis isn't configured for HeatMapChart and a String axis is fed by default to the xAxisType prop of CartesianChart |
@Shubhabrata08 Yes, you are right. You can find some discussions about this issue here. But the fix seems to be a bit more involved. Currently, a string axis is created regardless of the data type, which uses the d3 scaleBand utility. This utility has a bandwidth property that is used to determine the width and height of rectangles. The d3 scaleLinear and scaleTime utilities, used for number and date axes respectively, don't have such a property. We may need to figure out another way to resolve this issue. |
@krkshitij Is there a POC or draft under review currently regarding this issue? |
@Shubhabrata08 No, I haven't seen any. |
@AtishayMsft I found an approach to solve this issue. What we can do is whenever Adding prefix can remove localisation of date as number and there is no need to update cartesian component And further if we don't want the prefix to be printed we can just remove the "Y " from cartesian component and we will get the result This might not be the right approach. But this will not affect cartesian component. |
keep open |
Library
React / v8 (@fluentui/react)
System Info
Are you reporting Accessibility issue?
None
Reproduction
https://codepen.io/krkshitij/pen/yLZdGKp
Bug Description
Actual Behavior
Expected Behavior
The date x-axis in the above example should display the year as 1980 instead of 1,980
Logs
No response
Requested priority
Normal
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
The text was updated successfully, but these errors were encountered: