FastLineSeries does not respond to AppThemeBinding changes

Hello,

Using Syncfusion.Maui 27.1.53. I'm seeing this behavior both in Android and iOS.

I have a chart with a FastLineSeries like this:

<chart:FastLineSeriesYAxisName="DataAxis"
XAxisName="DateTimeAxis"
    ItemsSource="{Binding Data}"
    XBindingPath="Date"
    YBindingPath="DataValue"
    Fill="{AppThemeBinding Light={StaticResource LightTextColor}, Dark={StaticResource DarkTextColor}}">

When the app starts it uses whichever color is applicable but when the theme changes the color does not unless you restart the app. The other controls seem to be working but not FastLineSeries. I assume it is related to this:

AppThemeBinding doesn't work for Hint label | .NET MAUI Forums | Syncfusion As mentioned in that thread, I've tried to set the style for FastLineSeries but I'm having no luck. Help, please. Thanks, Alan


3 Replies 1 reply marked as answer

AJ Arul Jenith Berkmans Syncfusion Team October 22, 2024 01:18 PM UTC

Hi Alen,


We have reviewed your query and regret to inform you that, currently, we cannot set the AppThemeBinding for the FastLineSeries directly. However, you can achieve a similar effect by using AppThemeBinding in the PaletteBrushes property of the SfCartesianChart.


Here’s a simple code snippet:

<chart:SfCartesianChart.PaletteBrushes>

    <AppThemeBinding>

        <AppThemeBinding.Light>

            <x:Array Type="{x:Type Brush}">

                <StaticResource Key="LightBrush1" />

                <StaticResource Key="LightBrush2" />

                <StaticResource Key="LightBrush3" />

                <StaticResource Key="LightBrush4" />

            </x:Array>

        </AppThemeBinding.Light>

        <AppThemeBinding.Dark>

            <x:Array Type="{x:Type Brush}">

                <StaticResource Key="DarkBrush2" />

                <StaticResource Key="DarkBrush1" />

                <StaticResource Key="DarkBrush3" />

                <StaticResource Key="DarkBrush4" />

            </x:Array>

        </AppThemeBinding.Dark>

    </AppThemeBinding>

</chart:SfCartesianChart.PaletteBrushes>


We have also prepared a sample for your reference. If you need any further assistance, feel free to ask.


Thank you for your patience and understanding.


Regards,

Arul Jenith B.


Attachment: AppThemeBinding_67a9ecae.zip

Marked as answer

AH Alan Hoiland replied to Arul Jenith Berkmans October 22, 2024 07:41 PM UTC

Yes - that works!

Thanks,

Alan



PR Preethi Rajakandham Syncfusion Team October 24, 2024 05:24 AM UTC

Hi Alan Hoiland,

You're welcome.

We are glad to know that the reported problem has been resolved. Please let us know if you require any further assistance on this. We will be happy to assist you.

Regards,

Preethi R




Loader.
Up arrow icon