We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Theme Font ignored

I set a custom font in the app theme, but the charts ignore this font.

All fonts in the charts seem to be Roboto.

I tried to add TextStyle and LabelStyle to set my custom font.

but I haven't found how to define the tooltip or track point font.

How can I do this, and should the chart not just use the font specified in the theme by default? 


6 Replies

NR Natrayan Ramalingam Syncfusion Team March 3, 2023 01:50 PM UTC

Hi Matthias,


You can achieve your requirement by using the textStyle which is available in the tooltip behavior. Please refer to the following code snippet.


tooltipBehavior: TooltipBehavior(

     textStyle: TextStyle(

          fontFamily: 'Times New Roman',

     ),

),


Screenshot:

Chart, line chart

Description automatically generated


For more details, refer to the ug:

https://help.syncfusion.com/flutter/cartesian-charts/tooltip#customizing-the-appearance


If you still facing the issue, we kindly request you to share us with more about the issue in detail along with code snippets so that it will help us assist you in a better way.


Regards,

Natrayan



MK Matthias Koch March 3, 2023 07:02 PM UTC

Hi,


I use TrackballBehavior


SfCartesianChart(
enableSideBySideSeriesPlacement: true,
enableAxisAnimation: true,
trackballBehavior: TrackballBehavior(
enable: true,
activationMode: ActivationMode.singleTap,
tooltipDisplayMode: TrackballDisplayMode.groupAllPoints,
),


in the documentation it says: 

https://help.syncfusion.com/flutter/cartesian-charts/trackball-crosshair

that textStyle is an available property.


but when looking into the class:

https://pub.dev/documentation/syncfusion_flutter_charts/latest/charts/TrackballBehavior-class.html


it isn't.

that's why I don't know how to apply the font also in case using TrackBall.


Also, I wonder why not use ThemeFont by default. 

Now I need to set the font manually, on every axis, legend, tooltip, (trackball?) title, etc. 


thank you 




YG Yuvaraj Gajaraj Syncfusion Team March 6, 2023 02:24 PM UTC

Hi Matthias,


To customize the trackball tooltip text style, you can achieve this with the help of textStyle property in a tooltipSettings in TrackballBehavior. We have shared the code snippet below for your reference.


Code snippet:

SfCartesianChart(
trackballBehavior: TrackballBehavior(
enable: true,
tooltipSettings: InteractiveTooltip(
textStyle: TextStyle(
fontFamily: 'Calibri (Body)',
),
),
),
)


Currently, we don't have a support textStyle in SfChartThemeData. However, we have considered this as a feature request and logged the feature request for it in our feedback portal. This will be implemented and included in our 2023 Volume 2 release, which is expected to be rolled out on June 2023. We shared the feedback link below for your reference, you can track the status of the feature.


Feedback, https://www.syncfusion.com/feedback/41820/


Regards,

Yuvaraj.



MK Matthias Koch March 7, 2023 04:46 AM UTC

great, thank you very much :) 



YG Yuvaraj Gajaraj Syncfusion Team March 7, 2023 01:57 PM UTC

Hi Matthias,


Most Welcome. We will update you once the release got rolled out and we appreciate your patience until then.


Regards,

Yuvaraj.



LA Lavanya Anaimuthu Syncfusion Team June 22, 2023 02:04 PM UTC

Hi Matthias,


We are glad to announce that our Essential Studio 2023 Volume 2 release v22.1.34 is rolled out and is available for download under the following link.


https://www.syncfusion.com/forums/183035/essential-studio-2023-volume-2-main-release-v22-1-34-is-available-for-download


We have provided the global text theme support for charts widget and rolled out in this release. So, kindly please upgrade the charts widget package version to the latest version below to overcome the issue.


https://pub.dev/packages/syncfusion_flutter_charts/versions/22.1.34


For more details, please refer the API details here https://pub.dev/documentation/syncfusion_flutter_core/latest/theme/SfChartThemeData-class.html


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,          

Lavanya A.


Loader.
Up arrow icon