Skip to content

Resolved the chart data label binding issues on release mode.#694

Merged
jfversluis merged 1 commit intodotnet:mainfrom
sheiksyedm:chartDataLabelIssue
Oct 21, 2025
Merged

Resolved the chart data label binding issues on release mode.#694
jfversluis merged 1 commit intodotnet:mainfrom
sheiksyedm:chartDataLabelIssue

Conversation

@sheiksyedm
Copy link
Contributor

This pull request resolves an issue where nested bindings of custom chart data label objects were not working properly in Release mode due to AOT compilation being enabled in the chart library.
To address this, a Converter class has been added to ensure the bindings work correctly in all build modes

Chart Data Label Formatting Improvements:

  • Added the new ChartDataLabelConverter class to provide custom formatting for chart data labels, allowing the chart to display either the category title or count based on the converter parameter. (10.0/Apps/DeveloperBalance/Pages/Controls/ChartDataLabelConverter.cs)
  • Registered the ChartDataLabelConverter as a resource in the SfCircularChart so it can be used in label templates. (10.0/Apps/DeveloperBalance/Pages/Controls/CategoryChart.xaml)
  • Updated the chart label template to use the converter for both the title and count fields, replacing direct property bindings with converter-based bindings for improved flexibility and maintainability. (10.0/Apps/DeveloperBalance/Pages/Controls/CategoryChart.xaml)

Type Safety and XAML Enhancements:

  • Added x:DataType="pageModels:MainPageModel" to the root element of CategoryChart.xaml to enable compile-time type checking and resolved the binding warnings. . (10.0/Apps/DeveloperBalance/Pages/Controls/CategoryChart.xaml)
  • Specified x:DataType="chart:ChartDataLabel" in the HorizontalStackLayout within the label template for better type safety in the data template. (10.0/Apps/DeveloperBalance/Pages/Controls/CategoryChart.xaml)

@jfversluis jfversluis merged commit d7a2ea0 into dotnet:main Oct 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants