Skip to content

Conversation

@aruljenithberkmans
Copy link
Contributor

@aruljenithberkmans aruljenithberkmans commented May 15, 2025

Description

When setting the AppThemeBinding to tooltipBehavior background color, the tooltip background was not updated when the theme was changed.

#159

Root Cause of the Issue

To set the internal property values to the behavior background property, the binding property was overridden to the value property, so the appthemebinding values were not dynamically updated.

Changes description

Set the Behavior background property value to tooltipinfo. If it is null means to set the tooltip background that was applied in the resource key, and if it is also null means to set the default values for the tooltip background.

Test cases

  1. Test with Appthemebinding for Background property and change the theme dynamically and load time.
  2. Test with Resource key for Tooltipbackground property and change the theme dynamically and load time.
  3. Test the Both AppThemeBidning and TooltipBackground resource key.
  4. Test without both AppthemeBinding and TooltipBackground resource key.

Test this cases for Caresian, Circular, Funnel, Pyramid and Polar chart.

Screenshots

Before:

BeforeChanges.mp4

After:

AfterChanges.mp4

@Saravanan-Madhesh
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Saravanan-Madhesh Saravanan-Madhesh changed the title Fix tooltip background was not updated when the theme was changed. I159-Fix tooltip background was not updated when the theme was changed. May 15, 2025
@PaulAndersonS PaulAndersonS requested a review from Copilot May 16, 2025 04:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the tooltip background was not updating when the theme was changed by replacing calls to the old SetDefaultTooltipValue method with inline fallback logic and a new centralized UpdateTooltipAppearance method.

  • Removed SetDefaultTooltipValue calls and adjusted tooltip property fallback logic across chart components.
  • Updated unit tests and default behavior tests to reflect the new dynamic update approach.
  • Consolidated tooltip appearance updates into a common method in ChartSeries.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Chart/Features/ChartUnitTests.cs Updated tests to assert tooltip property values directly from the chart instance.
maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Chart/DefaultTests/BehaviorDefaultTests.cs Adjusted expectations for default tooltip values to match new logic.
maui/src/Charts/SfPyramidChart.cs, SfPolarChart.cs, SfFunnelChart.cs, etc. Replaced old SetDefaultTooltipValue calls with inline fallback logic via UpdateTooltipAppearance.
maui/src/Charts/Series/* Removed individual assignments for tooltip properties and centralized appearance updates via UpdateTooltipAppearance.
maui/src/Charts/ChartBase.cs, Behaviors/ChartTooltipBehavior.cs Removed legacy default value creators and SetDefaultTooltipValue, updating default handling for tooltip behavior.
Comments suppressed due to low confidence (1)

maui/src/Charts/ChartBase.cs:684

  • The removal of the SetDefaultTooltipValue call here means that default tooltip properties are no longer initialized immediately. Please verify that scenarios such as SaveAsImage properly trigger UpdateTooltipAppearance so that fallback values are correctly applied.
SetDefaultTooltipValue(_defaultToolTipBehavior);

@aruljenithberkmans
Copy link
Contributor Author

Issue link

The tooltip background doesn't update dynamically when changing the theme with AppThemeBinding. We have addressed four cases for this fix:

Case 1: If AppThemeBinding is used or a specific value is set for the tooltip background, that value should be applied as the background.

Case 2: If the Syncfusion TooltipBackground resource key is used to set the tooltip background, it should be applied as the background.

Case 3: If no values are set for the background, default values should be applied.

Case 4: If both a specific background value and the Syncfusion resource key are used, the specific background value should take priority, and the resource key values should be ignored.

Copy link
Collaborator

@Saravanan-Madhesh Saravanan-Madhesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes fine.

@Saravanan-Madhesh Saravanan-Madhesh merged commit a1135f0 into syncfusion:main May 16, 2025
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