-
Notifications
You must be signed in to change notification settings - Fork 846
[syncfusion_flutter_charts] Pie Chart data labels throw Invalid argument(s): string is not well-formed UTF-16
#1611
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 @btrautmann , We can be able to replicate the reported issue at our end, issue occurs in framework while try to layout the text painter with partially trimmed emoji. We will check the flutter framework and update the solution for this case. For example, below simple code raises the reported exception. ` @OverRide
….. ` However, you can resolve this issue by using builder data label and you can achieve the same ui with below code snippet. ` DoughnutSeries<PieChartData, String>( ` Please let us know if you need any further assistance on this. Regards, |
I attempted to use the above code but the labels are not showing. Oddly, if I replace the |
Hi @btrautmann, We were able to replicate the reported issue using the attached repo you provided. We would like to let you know that the issue regarding ‘data label are not showing’ is occurring because you missed updating the fontSize in the Text widget inside the builder data label. We have shared a code snippet and for your reference. `DoughnutSeries<PieChartData, String>(
` Please let us know if you need any further assistance on this. Regards, |
@PreethikaSelvam I gave that a shot (see latest commit in the repo) but the result is the same unfortunately. |
@PreethikaSelvam and word on this? Also:
Does this mean you opened an issue with |
Hi Team, Query 1: I tried the solution mentioned (see latest commit in the repository), but unfortunately, the result remains the same. We have checked your GitHub repository and found that it was working fine on our end. We have attached the screenshot and screenrecording below inside the Zip folder. However, we kindly request you to provide us with more detailed information along with screenshots or screen recordings. This will help us assist you more effectively. Screenshot: We also need the following details to check the mentioned issue:
Query 2: I would like to confirm if you have opened an issue with flutter/flutter. If so, could you please provide us with the link? For the mentioned issue regarding 'When using text painter with partially trimmed emoji, an Exception arises', we have created a GitHub issue and logged it in the Framework. For your reference, please find the attached GitHub link below. If you have any further inquiries, please feel free to contact us. GitHub issue Link - flutter/flutter#142037 Regards, |
Thanks for pointing me to the framework issue! I've run the sample again and recorded a video of what I'm seeing. I'm not sure if this behavior is expected, but it's definitely related to screen size. The pie chart labels do not render at all as screen size decreases. iPhone 13 mini and MacOS Desktop: Screen.Recording.2024-01-23.at.11.37.21.mov |
Hi @btrautmann, We would like to let you know that the data label will be displayed based on the screen size. If the screen size is smaller, the data label will be hidden, and only the chart will be rendered. This is a current behavior. However, currently we do not have support for ‘positioning the data label based on the available place’. Therefore, we have already considered your requirement as a new feature and logged feature request for it in our feedback portal. We will prioritize the features of every release based on demand and priority. So, this feature will be available in any of our upcoming releases. You can also track the status of the feature with the feedback below. FR Link, Regards, Preethika Selvam. |
Understood, and that makes sense. Thank you! I think we can leave this issue open as the root issue still exists and is being tracked by flutter/flutter#142037. |
Following up on the above |
Hi @btrautmann, We would like to inform you that the data label builder will be hidden when it does not have enough space to render entirely. This is the current behavior. We understand your requirements and needs, so we have considered this a new feature and have logged a feature request for it in our feedback portal. We will prioritize the features of every release based on demand and priority. So, this feature will be available in any of our upcoming releases. You can also track the status of the feature with the feedback below. Please let us know if you need any further assistance. Regards, |
@PreethikaSelvam the original issue is the incorrect truncation of text containing emojis. You already opened an internal issue for the above problem RE: label layout and linked it in #1611 (comment). I think the issue you mentioned in #1611 (comment) is now redundant. I have opened #1661 which addresses the root issue here. Note that the PR does not attempt to solve all instances of this problem, but rather serves to demonstrate a fix for the root cause. Please check it out and let me know if you have questions. |
Hi @btrautmann, We would like to let you know that we have logged two feature requests. The first feature request (FR) is to reposition the data label based on the available space. In this case, the shift position will be modified based on the available size. The second FR is to restrict the data label builder size instead of hiding it based on the available size. Therefore, the above two feature requests are correct and as mentioned in previous updates, they will be implemented in one of our upcoming releases. Furthermore, we are pleased to hear that you have discovered the root cause here: #1661 will check this and consider all related features to determine the feasibility of incorporating your fix into our feature request implementation while implementing this feature: https://www.syncfusion.com/feedback/50685/provide-an-option-to-trim-the-data-label-builder-instead-of-hiding-it-based-on-the. Regards, Preethika Selvam. |
I've been getting reports of users experiencing issues with their pie charts, see the below logs:
Stacktrace
I was able to reproduce this and a repro case is here. Just check that repo out and run the code, the pie chart is the first one in the list.
Note:
The issue is reproduced only (as far as I can tell) when the name ends with an emoji. If the truncation of the labels is being performed by the charts library somewhere (I couldn't find it, but didn't look TOO hard), it's likely an issue similar to this one and needs a slight adjustment to use the
String
runes
as described there.The text was updated successfully, but these errors were encountered: