Hi,
I am facing a UI issue on Pie Chart. Label is being drawn outside the segment area for the same data.
Here are the images for references.
We have checked the data. It is the same for the both scenarios. There is only one segment. So the value is always 100%.
Hi Rashidul,
After investigating your query, it seems like you need to display the percentage of the value for the given data directly in the data labels on the Pie Chart. To achieve this, you can use the LabelContext property in the series and set it to Percentage.
By configuring the LabelContext property in this way, the data labels will automatically display the percentage of the Y value for the respective segment.
For detailed instructions on how to configure data labels and utilize the LabelContext property to display percentages, please refer to the following user guide documentation:
UG Documentation link: Formatting Label Context
If the proposed solution does not meet your requirements or if you need further assistance, please provide additional information about the issue you are facing. We are here to help.
Regards,
Dhanaraj Rajendran.
Thanks for the reply.
Here we are using custom label for each segment. The issue is - the label is drawn outside the segment area sometimes not always that was indicating on the attached images.
Here I have added the code of label template if you are interested.
<DataTemplate x:Key="_pieChartLabelTemplate">
<Label Style="{StaticResource _rubik10}"
Text="{Binding Item.ItsLabelText}"/>
</DataTemplate>
ShowDataLabels="True" LabelTemplate="{StaticResource _pieChartLabelTemplate}"
Hi Rashidul,
Thank you for sharing the details. We were able to reproduce the reported issue of data labels occasionally appearing outside the segment area. Upon validation, we observed that the position of the data labels changes when resizing the chart. We need some time to further investigate the issue with our source code. We will provide an update on or before tomorrow (25/04/2024).
Regards,
Dhanaraj Rajendran.
Hi Rashidul,
After validating the issue, we have confirmed that it is indeed a bug. We will provide you with the details of the bug report regarding the issue of data label positioning in circular chart when resizing on or before tomorrow (26/04/2024).
Regards,
Dhanaraj Rajendran
Hi Rashidul,
We have created the bug report for the reported issue of data label positioning in circular chart when resizing. You can track the status in the following feedback portal link.
Bug Report: Resolving the data label positioning issue when resizing in .NET MAUI SfCircularChart
The fix will be available in the upcoming weekly NuGet release on or before May 14th, 2024.
Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.
Thank you for your patience and understanding.
Regards,
Dhanaraj Rajendran
Hi Rashidul,
We have fixed the reported issue of the chart data label position changed inner and outer when resizing the window in circular chart has been included in our latest weekly Nuget release, version 25.1.42 which is available for download (https://www.nuget.org/).
NuGet Version: 25.1.42
Root cause: During resizing, the Circular series fails to reset the AdjacentLabelRect field to zero, which causes it to retain the last updated segment inner rectangle. Consequently, the intersecting condition evaluates to false, leading to data label rendering outside the desired area
Action taken: In the single segment, the Circular series' AdjacentLabelRect field has been reset to zero.
We thank you for your support and appreciate your patience. Please contact us if you require any further assistance.
Regards,
Nanthini M.