-
Notifications
You must be signed in to change notification settings - Fork 837
SfCartesianChart - Inconsistent Data Label Position in Bar Chart #2313
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
Comments
Hi @alunparanggi, According to our current data label implementation, we adjust the label placement when it exceeds the source boundary to ensure visibility. In your case, the labels for the first and last bars are repositioned within the chart’s bounds, causing a slight shift. This behavior is intentional to prevent labels from being clipped. To remove this adjustment, we suggest using Transform.translate in the data label builder with a dynamically adjusted offset, ensuring labels remain correctly positioned based on the platform and index, preventing overlap or out-of-bounds placement for a consistent display across devices. You can adjust the dynamicOffsetX values as needed. We have shared a modified code snippet, sample and output for your reference. Code snippet:
Output: Windows: Web: Please let us know if you need any further assistance. Regards, |
Please reopen this ticket, if you need further assistance with this. |
Bug description
In some cases, the data labels in the bar chart either disappear completely or shift slightly, while in other cases, they appear correctly.
I'm not sure what is causing this issue—perhaps the
Transform
widget or some other factor. I have tried avoiding a builder and instead using theangle: 90
parameter inDataLabelSettings
, but the issue still occurs.Steps to reproduce
There are no specific steps to reproduce this behavior.
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
labelIntersectAction: LabelIntersectAction.none
when

labelIntersectAction: LabelIntersectAction.shift
some labels are completely goneStack Traces
Stack Traces
no stack trace is available
On which target platforms have you observed this bug?
iOS
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: