From 421e1b11cd8236503ca6577706ef605b8a31cc5c Mon Sep 17 00:00:00 2001 From: AswiniDileep Date: Thu, 30 Oct 2025 10:06:44 +0530 Subject: [PATCH 1/8] MAUI-988662-[Others]: Updated UG for KB --- maui-toolkit-toc.html | 1 + ...play-tooltip-datalabels-in-release-mode.md | 70 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md diff --git a/maui-toolkit-toc.html b/maui-toolkit-toc.html index be427528..bf841fd9 100644 --- a/maui-toolkit-toc.html +++ b/maui-toolkit-toc.html @@ -168,6 +168,7 @@
  • Add custom labels to the chart axis
  • Customize each chart axis label using the callback event
  • Get the data point collection based on region
  • +
  • Display tooltip and datalabels in release mode
  • diff --git a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md new file mode 100644 index 00000000..25e526a4 --- /dev/null +++ b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md @@ -0,0 +1,70 @@ +--- +layout: post +title: Display tooltip and datalabels in release mode in Syncfusion SfCartesianChart +description: Learn here all about displaying tooltip and datalabels in release mode in SfCartesianChart in Syncfusion® .NET MAUI Chart (SfCartesianChart) control. +platform: maui-toolkit +control: SfCartesianChart +documentation: ug +keywords: .NET MAUI chart tooltip, .NET MAUI chart data label, TooltipInfo Item binding, ChartDataLabel Item binding, Release mode trimming, Preserve attribute MAUI. +--- + +# Display tooltip and datalabels in release mode .NET MAUI SfCartesianChart + +The `binding context` inside tooltip and datalabels templates is not your model directly. These templates run in the scope of [TooltipInfo](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.TooltipInfo.html) and [ChartDataLabel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartDataLabel.html), which expose an `Item` property that contains the actual data model from the charts [ItemsSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartSeries.html#Syncfusion_Maui_Charts_ChartSeries_ItemsSource). To read your model’s fields in a template, bind through Item or converter. + + +{% highlight xaml %} + + + ..... + + + + + + + + + + + + + + + + +{% endhighlight %} + + +{% highlight C# %} + + public class TooltipConverter : IValueConverter + { + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + // value is TooltipInfo.Item or ChartDataLabel.Item -> your Model + if (value is Model model && parameter?.ToString() == "Planned") + return model.Planned; + + return value; + } + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => value; + } + +{% endhighlight %} + +## See also + +[How to display tooltip and datalabels in release mode .NET MAUI SfCartesianChart](https://support.syncfusion.com/kb/article/21677/why-tooltip-and-datalabel-are-not-showing-in-release-mode-in-net-maui-sfcartesianchart) \ No newline at end of file From 63d975f5a9529ecef6ff73799ee1d3277c225d78 Mon Sep 17 00:00:00 2001 From: AswiniDileep Date: Thu, 30 Oct 2025 10:17:42 +0530 Subject: [PATCH 2/8] MAUI-988662-[Others]: Update title --- .../Display-tooltip-datalabels-in-release-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md index 25e526a4..62568956 100644 --- a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md +++ b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md @@ -1,6 +1,6 @@ --- layout: post -title: Display tooltip and datalabels in release mode in Syncfusion SfCartesianChart +title: Display tooltip and datalabels in release mode in SfCartesianChart description: Learn here all about displaying tooltip and datalabels in release mode in SfCartesianChart in Syncfusion® .NET MAUI Chart (SfCartesianChart) control. platform: maui-toolkit control: SfCartesianChart @@ -8,7 +8,7 @@ documentation: ug keywords: .NET MAUI chart tooltip, .NET MAUI chart data label, TooltipInfo Item binding, ChartDataLabel Item binding, Release mode trimming, Preserve attribute MAUI. --- -# Display tooltip and datalabels in release mode .NET MAUI SfCartesianChart +# Display tooltip and datalabels in release mode The `binding context` inside tooltip and datalabels templates is not your model directly. These templates run in the scope of [TooltipInfo](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.TooltipInfo.html) and [ChartDataLabel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartDataLabel.html), which expose an `Item` property that contains the actual data model from the charts [ItemsSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartSeries.html#Syncfusion_Maui_Charts_ChartSeries_ItemsSource). To read your model’s fields in a template, bind through Item or converter. From 076ab7fe157c158c52487b5686499f4619982c21 Mon Sep 17 00:00:00 2001 From: AswiniDileep Date: Thu, 30 Oct 2025 10:24:16 +0530 Subject: [PATCH 3/8] MAUI-988662-[Others]: Updated title --- .../Display-tooltip-datalabels-in-release-mode.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md index 62568956..1acc9fe1 100644 --- a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md +++ b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md @@ -1,6 +1,6 @@ --- layout: post -title: Display tooltip and datalabels in release mode in SfCartesianChart +title: Display tooltip and datalabels in release mode in Syncfusion SfCartesianChart description: Learn here all about displaying tooltip and datalabels in release mode in SfCartesianChart in Syncfusion® .NET MAUI Chart (SfCartesianChart) control. platform: maui-toolkit control: SfCartesianChart @@ -8,9 +8,9 @@ documentation: ug keywords: .NET MAUI chart tooltip, .NET MAUI chart data label, TooltipInfo Item binding, ChartDataLabel Item binding, Release mode trimming, Preserve attribute MAUI. --- -# Display tooltip and datalabels in release mode +# Display tooltip and data labels in release mode -The `binding context` inside tooltip and datalabels templates is not your model directly. These templates run in the scope of [TooltipInfo](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.TooltipInfo.html) and [ChartDataLabel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartDataLabel.html), which expose an `Item` property that contains the actual data model from the charts [ItemsSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartSeries.html#Syncfusion_Maui_Charts_ChartSeries_ItemsSource). To read your model’s fields in a template, bind through Item or converter. +The `binding context` inside tooltip and data labels templates is not your model directly. These templates run in the scope of [TooltipInfo](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.TooltipInfo.html) and [ChartDataLabel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartDataLabel.html), which expose an `Item` property that contains the actual data model from the charts [ItemsSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartSeries.html#Syncfusion_Maui_Charts_ChartSeries_ItemsSource). To read your model’s fields in a template, bind through Item or converter. {% highlight xaml %} @@ -67,4 +67,4 @@ The `binding context` inside tooltip and datalabels templates is not your model ## See also -[How to display tooltip and datalabels in release mode .NET MAUI SfCartesianChart](https://support.syncfusion.com/kb/article/21677/why-tooltip-and-datalabel-are-not-showing-in-release-mode-in-net-maui-sfcartesianchart) \ No newline at end of file +[How to display tooltip and data labels in release mode .NET MAUI SfCartesianChart](https://support.syncfusion.com/kb/article/21677/why-tooltip-and-datalabel-are-not-showing-in-release-mode-in-net-maui-sfcartesianchart) \ No newline at end of file From 1ab632fcf034aa9369f66e61fea927a08700694a Mon Sep 17 00:00:00 2001 From: AswiniDileep Date: Thu, 30 Oct 2025 11:11:32 +0530 Subject: [PATCH 4/8] MAUI-988662-[Others]: Updated content --- maui-toolkit-toc.html | 2 +- .../Display-tooltip-datalabels-in-release-mode.md | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/maui-toolkit-toc.html b/maui-toolkit-toc.html index bf841fd9..86040038 100644 --- a/maui-toolkit-toc.html +++ b/maui-toolkit-toc.html @@ -168,7 +168,7 @@
  • Add custom labels to the chart axis
  • Customize each chart axis label using the callback event
  • Get the data point collection based on region
  • -
  • Display tooltip and datalabels in release mode
  • +
  • Display tooltip and datalabels in release mode
  • diff --git a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md index 1acc9fe1..30d87e83 100644 --- a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md +++ b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md @@ -10,7 +10,10 @@ keywords: .NET MAUI chart tooltip, .NET MAUI chart data label, TooltipInfo Item # Display tooltip and data labels in release mode -The `binding context` inside tooltip and data labels templates is not your model directly. These templates run in the scope of [TooltipInfo](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.TooltipInfo.html) and [ChartDataLabel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartDataLabel.html), which expose an `Item` property that contains the actual data model from the charts [ItemsSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartSeries.html#Syncfusion_Maui_Charts_ChartSeries_ItemsSource). To read your model’s fields in a template, bind through Item or converter. +The binding context inside tooltip and data labels templates is not your model directly. These templates run in the scope of [TooltipInfo](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.TooltipInfo.html) and [ChartDataLabel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartDataLabel.html), which expose an `Item` property that contains the actual data model from the charts [ItemsSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartSeries.html#Syncfusion_Maui_Charts_ChartSeries_ItemsSource). To read your model’s fields in a template, bind through Item or use a converter. + + +With .NET 9 compiled bindings, tooltip templates run with **x:DataType="chart:TooltipInfo"** and data label templates run with **x:DataType="chart:ChartDataLabel"**. Inside these templates, bind to the model via the Item property. Use a value converter to pull the required field from Item. In Release builds, trimming/AOT can remove XAML-only types, so preserve your ViewModel, Model, and the converter to keep these bindings working. {% highlight xaml %} From eb20108e8e05dec747f9e3e28e88dc76f3dccc79 Mon Sep 17 00:00:00 2001 From: AswiniDileep Date: Thu, 30 Oct 2025 15:41:56 +0530 Subject: [PATCH 5/8] MAUI-988662-[Others]: Updated title to clear warning --- .../Display-tooltip-datalabels-in-release-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md index 30d87e83..d87ee1d7 100644 --- a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md +++ b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md @@ -1,6 +1,6 @@ --- layout: post -title: Display tooltip and datalabels in release mode in Syncfusion SfCartesianChart +title: Show tooltip and datalabels in release mode | Syncfusion description: Learn here all about displaying tooltip and datalabels in release mode in SfCartesianChart in Syncfusion® .NET MAUI Chart (SfCartesianChart) control. platform: maui-toolkit control: SfCartesianChart From 745f3957f88685e1c447faa661f6d6ba2ea8f933 Mon Sep 17 00:00:00 2001 From: AswiniDileep Date: Wed, 5 Nov 2025 10:37:01 +0530 Subject: [PATCH 6/8] MAUI-988662-[Others]: Updated UG with proper code lines --- ...play-tooltip-datalabels-in-release-mode.md | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md index d87ee1d7..b9fc88cd 100644 --- a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md +++ b/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md @@ -19,33 +19,38 @@ With .NET 9 compiled bindings, tooltip templates run with **x:DataType="chart:To {% highlight xaml %} - ..... - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + {% endhighlight %} @@ -53,7 +58,7 @@ With .NET 9 compiled bindings, tooltip templates run with **x:DataType="chart:To {% highlight C# %} - public class TooltipConverter : IValueConverter + public class ValueConverter : IValueConverter { public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { From c8c0f026172f5aff0b22b92548f4127ee73bba50 Mon Sep 17 00:00:00 2001 From: AswiniDileep Date: Tue, 2 Dec 2025 19:06:45 +0530 Subject: [PATCH 7/8] Updated UG content review suggestions --- maui-toolkit-toc.html | 2 +- ...ata-labels-not-visible-in-release-mode.md} | 21 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) rename maui-toolkit/Cartesian-Charts/{Display-tooltip-datalabels-in-release-mode.md => Why-tooltip-and-data-labels-not-visible-in-release-mode.md} (57%) diff --git a/maui-toolkit-toc.html b/maui-toolkit-toc.html index 86040038..c3b20c88 100644 --- a/maui-toolkit-toc.html +++ b/maui-toolkit-toc.html @@ -168,7 +168,7 @@
  • Add custom labels to the chart axis
  • Customize each chart axis label using the callback event
  • Get the data point collection based on region
  • -
  • Display tooltip and datalabels in release mode
  • +
  • Display tooltip and datalabels in release mode
  • diff --git a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md b/maui-toolkit/Cartesian-Charts/Why-tooltip-and-data-labels-not-visible-in-release-mode.md similarity index 57% rename from maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md rename to maui-toolkit/Cartesian-Charts/Why-tooltip-and-data-labels-not-visible-in-release-mode.md index b9fc88cd..f42fb175 100644 --- a/maui-toolkit/Cartesian-Charts/Display-tooltip-datalabels-in-release-mode.md +++ b/maui-toolkit/Cartesian-Charts/Why-tooltip-and-data-labels-not-visible-in-release-mode.md @@ -10,10 +10,14 @@ keywords: .NET MAUI chart tooltip, .NET MAUI chart data label, TooltipInfo Item # Display tooltip and data labels in release mode -The binding context inside tooltip and data labels templates is not your model directly. These templates run in the scope of [TooltipInfo](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.TooltipInfo.html) and [ChartDataLabel](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartDataLabel.html), which expose an `Item` property that contains the actual data model from the charts [ItemsSource](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartSeries.html#Syncfusion_Maui_Charts_ChartSeries_ItemsSource). To read your model’s fields in a template, bind through Item or use a converter. +In [SfCartesianChart](https://help.syncfusion.com/cr/maui-toolkit/Syncfusion.Maui.Toolkit.Charts.SfCartesianChart.html), the binding context inside tooltip and data label templates is not your business model directly. These templates run with Chart specific contexts. +* Tooltip template: chart:[TooltipInfo](https://help.syncfusion.com/cr/maui-toolkit/Syncfusion.Maui.Toolkit.Charts.TooltipInfo.html) +* Data label template: chart:[ChartDataLabel](https://help.syncfusion.com/cr/maui-toolkit/Syncfusion.Maui.Toolkit.Charts.ChartDataLabel.html) -With .NET 9 compiled bindings, tooltip templates run with **x:DataType="chart:TooltipInfo"** and data label templates run with **x:DataType="chart:ChartDataLabel"**. Inside these templates, bind to the model via the Item property. Use a value converter to pull the required field from Item. In Release builds, trimming/AOT can remove XAML-only types, so preserve your ViewModel, Model, and the converter to keep these bindings working. +Both provide an `Item` property that references the actual data object from the series [ItemsSource](https://help.syncfusion.com/cr/maui-toolkit/Syncfusion.Maui.Toolkit.Charts.ChartSeries.html#Syncfusion_Maui_Toolkit_Charts_ChartSeries_ItemsSourceProperty). Bind your fields through Item to display values from your business model. + +Release builds can remove types that are referenced only from XAML. To prevent this, reference a value converter from XAML and preserve your ViewModel, business model, and converter classes. With .NET 9 compiled bindings, set **x:DataType="chart:TooltipInfo"** for tooltip templates and **x:DataType="chart:ChartDataLabel"** for data label templates, then bind via Item. Use the converter to extract the required property from Item. {% highlight xaml %} @@ -60,19 +64,16 @@ With .NET 9 compiled bindings, tooltip templates run with **x:DataType="chart:To public class ValueConverter : IValueConverter { - public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - // value is TooltipInfo.Item or ChartDataLabel.Item -> your Model - if (value is Model model && parameter?.ToString() == "Planned") - return model.Planned; - - return value; + return value is WeekPlan weekPlan ? weekPlan.Planned : value; } - public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => value; + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => value; } {% endhighlight %} ## See also -[How to display tooltip and data labels in release mode .NET MAUI SfCartesianChart](https://support.syncfusion.com/kb/article/21677/why-tooltip-and-datalabel-are-not-showing-in-release-mode-in-net-maui-sfcartesianchart) \ No newline at end of file +[Why Tooltip and DataLabel Are Missing in Release Mode .NET MAUI Chart?](https://support.syncfusion.com/kb/article/21677/why-tooltip-and-datalabel-are-not-showing-in-release-mode-in-net-maui-sfcartesianchart) \ No newline at end of file From da37f397e3187e3fd28dbaa5c6b340f11e2f404c Mon Sep 17 00:00:00 2001 From: AswiniDileep Date: Tue, 2 Dec 2025 19:18:46 +0530 Subject: [PATCH 8/8] Updated html title --- maui-toolkit-toc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maui-toolkit-toc.html b/maui-toolkit-toc.html index c3b20c88..779c31ef 100644 --- a/maui-toolkit-toc.html +++ b/maui-toolkit-toc.html @@ -168,7 +168,7 @@
  • Add custom labels to the chart axis
  • Customize each chart axis label using the callback event
  • Get the data point collection based on region
  • -
  • Display tooltip and datalabels in release mode
  • +
  • Why tooltip and data labels not visible in release mode