Change TextColor of Legend Item

Hello,  first of all thanks for the great work. The Controls are awesome. I've one little issue. In Dark Mode the Legend Text is not shown because the Text Color of the Legend Text is black. How kann I Change the TextColor of the Legend Text? Is it only possible with ItemTemplate? If Yes can you provide an working Example? Or is there somewhere  Style Attribute. Greetings from Germany

 


5 Replies

NT Nitheeshkumar Thangaraj Syncfusion Team July 27, 2023 07:31 AM UTC

Hi Sascha,


We have validated your query. We have support for item template in Chartlegend. Please find the API link below.

https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Charts.ChartLegend.html#properties


Additionally, if you want to see this feature in action and explore other Maui controls, you can access the Maui controls demo to have a hands-on experience.

https://github.com/syncfusion/maui-demos/tree/master/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Legend

For more details and a comprehensive guide on how to use the ItemTemplate support for chart legends, you can visit the Knowledge Base (Kb) link provided below:

https://support.syncfusion.com/kb/article/12126/how-to-customize-the-legend-items-in-net-maui-chart-sfcircularchart


If you have any specific questions or need further assistance, feel free to ask


Regards,

Nitheeshkumar.



SI Sascha Ingenohl July 27, 2023 11:48 AM UTC

Thx.  I need an example for a circular chart too. 



SM Saravanan Madheswaran Syncfusion Team July 28, 2023 04:03 AM UTC

Hi Sascha,


The below KB explains the example with a circular chart.


https://support.syncfusion.com/kb/article/12126/how-to-customize-the-legend-items-in-net-maui-chart-sfcircularchart


And find the sample browser demo in below location [CustomizeRadialBar sample].


https://github.com/syncfusion/maui-demos/tree/master/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/Samples/CircularChart/RadialBar


Regards,

Saravanan.



MN Markus Nottbohm July 28, 2023 07:29 AM UTC

Hallo, 

I have also the issue, that the Legend on the Linechart is not visible on the dark mode. How to fix that?


...

 <chart:LineSeries

                        Label="ISSUE/HR"

    ItemsSource="{Binding Issue}"

                        Fill="{AppThemeBinding Light=Darkgreen, Dark=Lightgreen}"

                        EnableTooltip="True"

                        XBindingPath="date"

    YBindingPath="value"/>

            <chart:LineSeries

                        Label="ISS_SHIPD/HR"

                        Fill="{AppThemeBinding Light=Darkblue, Dark=Orange}"

    ItemsSource="{Binding ISSShipd}"

                        EnableTooltip="True"

                        XBindingPath="date"

    YBindingPath="value"/>


...


Thanks,

Markus



NT Nitheeshkumar Thangaraj Syncfusion Team July 31, 2023 10:32 AM UTC

Hi Sascha,

With the provided code snippet the series fill was changed based on the themes in our end. There will be some issue as we not completed theme support for maui controls. Please find the feedback below,


https://www.syncfusion.com/feedback/40265/implement-the-theme-support-for-net-maui-controls


Please cast your vote to make it count, and if you have any more specifications/suggestions for the feature request, you can add them as a comment in the feedback portal.


Regards,

Nitheeshkumar.


Loader.
Up arrow icon